So I've been trying to make a macro that will check names against a data base and auto fill in their respective industry team. The list is sent to us in a certain format every month as shown below. if the name doesn't match anything in the data base I was trying to get it to highlight the row in red. Below are screen shots of the work sheet and the macro i attempted. I keep on getting error 13 mismatch. Major problem is the format of the list as youll see below
Screenshot (2).png
Screenshot (3).png
The macro I worked on
Sub checkcrmgmt()
Dim employee As String
Dim sh1 As Worksheet
Dim sh2 As Worksheet
Dim sh3 As Worksheet
Set sh1 = ActiveWorkbook.Sheets("Cover")
Set sh2 = ActiveWorkbook.Sheets("List")
Set sh3 = ActiveWorkbook.Sheets("mgmt")
sh2.Range("C2:C150").ClearContents
employee = sh2.Range("b2:b150")
For i = 5 To 1000
For C = 2 To 10000
For E = 5 To 150
If sh3.Cells(i, C) = sh2.Cells(E, 2) Then
sh3.Range(Cells(i, 1).End(xlUp)).Copy
sh2.Range(E, 3).PasteSpecial x1pasteformulasandnumberformats
Else
Rows(E).Interior.ColorIndex = 3
End If
Next E
Next C
Next i
End Sub
Screenshot (5).png
Bookmarks