The goal of this macro is to compare two lists (columns) A and B (A>B). For each value that in B that also exists in A I want an "x" offset from the value in A. So far so good.
For each value in B that does not exist in A, I want the value to be marked red in B. I don't know how to get the last part to work. Can you help me please? Thank you.
For each value in B that does not exist in A, I want the value to be marked red in B. I don't know how to get the last part to work. Can you help me please? Thank you.
Code:
Sub Find_Matches()
Dim CompareRange As Variant, x As Variant, y As Variant
' Set CompareRange equal to the range to which you will
' compare the selection.
Set CompareRange = Range("F1:F100")
' Loop through each cell in the selection and compare it to
' each cell in CompareRange.
For Each x In Selection
For Each y In CompareRange
If x = y Then y.Offset(0, 10) = "x" Else x.Interior.ColorIndex = 3
Next y
Next x
End Sub