The first solution compares one line at a time so using the macro on the new example file it stops working if there are more entries in the one data set as far as I can tell.
Second solution offered adds one color to row 2 and another color to the remaining rows containing data.
What I have tried so far is to concatenate the value of the two columns in each set, write these to two new ranges in the sheet and then do a comparison of these new colums using the following code:
Private Sub MarkAllUnfoundCells(r1 As Range, r2 As Range)
Dim c As Range
For Each c In r1.Cells
If Not IsInRange(r2, c.Value) Then
c.Interior.ColorIndex = 3
End If
Next
End Sub
Private Function IsInRange(r As Range, target As String) As Boolean
Dim c As Range
For Each c In r.Cells
If c.Value = target Then
IsInRange = True
Exit Function
End If
Next
IsInRange = False
End Function
Just passing on the two new ranges to the private sub that uses the function IsInRange.
The problem with this approach is speed. Comparing two ranges with approximately 10,000 rows or more takes a lot of time. First writing the two new columns and afterwards comparing the value of a single cell with each cell in the second range.
Doing this also only paints one color if there is a mismatch and it does so in the new columns created.
Bookmarks