Sub compare()
Dim wb As Worksheet
Dim wb2 As Worksheet
Set wb = Workbooks("JonFile1.xlsm").Sheets(1)
Set wb2 = Workbooks("JonFile2.xlsm").Sheets(1)
Dim Found As Boolean
i = 2
Do While wb2.Range("A" & i).Value <> ""
On Error Resume Next
If (IsError(Application.WorksheetFunction.VLookup(wb2.Range("A" & i).Value, wb.Range("A:A"), 1, False))) Then
Else
Found = True
End If
If (Found) Then
wb2.Range("B" & i).Value = "Found"
Found = False
Else
wb2.Range("A" & i)..Interior.Color = 12345
wb2.Range("B" & i).Value = "Missing " & wb.Parent.Name
End If
On Error Resume Next
If (IsError(Application.WorksheetFunction.VLookup(wb.Range("A" & i).Value, wb2.Range("A:A"), 1, False))) Then
Else
Found = True
End If
If (Found) Then
wb.Range("B" & i).Value = "Found"
Found = False
Else
wb.Range("A" & i).Interior.Color = 12345
wb.Range("B" & i).Value = "Missing " & wb2.Parent.Name
End If
i = i + 1
Loop
Bookmarks