So, I'm new to VBA, so go easy.
I have two different worksheets-- Merged Nativity Codes and 2007-2011 Nativity Codes. I want to iterate through all the values in the 2007-2011 codes (Column B) and compare that to the values in Column A of Merged Nativity Codes. I want to highlight the content that is in the 2007-2011 codes, but not in the Merged Nativity Codes.
I tried my hand at this VBA macro:
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim ws3 As Worksheet
Set ws1 = Worksheets("2002-2006 Nativity Codes")
Set ws2 = Worksheets("Merged Nativity Codes")
Set ws3 = Worksheets("2007-2011 Nativity Codes")
For Each i In ws3.Range("B2:B154")
For Each C In ws2.Range("A1:A138")
If i.Cells.Value <> C.Cells.Value Then
i.Cells.Interior.ColorIndex = 3
End If
Next C
Next i
But the problem is that " If i.Cells.Value <> C.Cells.Value Then" will be triggered if only one doesn't match. I'm looking for something like the "all()" function in Python. Does this exist? Easier way to do this?