Hello,
I'm trying to put a command in VBA that will check to see if the cell value in column A and B have the exact same string. Basically, comparing A2 <-> B2, A3 <-> B3 <->A4 <-> B4... etc all the way down the entire column.
Then when it see the strings are not exact, to highlight it (see below).
So far I got:
With Sheets("Audit")
Dim Ary As Variant
Dim Cl As Range
Ary = Split(Range("'A:A"))
For Each Cl In Range("B2", Range("B" & Rows.Count).End(xlUp))
If InStr(1, Cl, Ary(0), vbTextCompare) = 0 And InStr(1, Cl, Ary(UBound(Ary)), vbTextCompare) = 0 Then
Cl.Interior.Color = 13551615
End If
Next Cl
End With
Which isn't working... Any suggestions? I feel like it's something basic i'm missing.
I'm trying to put a command in VBA that will check to see if the cell value in column A and B have the exact same string. Basically, comparing A2 <-> B2, A3 <-> B3 <->A4 <-> B4... etc all the way down the entire column.
Then when it see the strings are not exact, to highlight it (see below).
So far I got:
With Sheets("Audit")
Dim Ary As Variant
Dim Cl As Range
Ary = Split(Range("'A:A"))
For Each Cl In Range("B2", Range("B" & Rows.Count).End(xlUp))
If InStr(1, Cl, Ary(0), vbTextCompare) = 0 And InStr(1, Cl, Ary(UBound(Ary)), vbTextCompare) = 0 Then
Cl.Interior.Color = 13551615
End If
Next Cl
End With
Which isn't working... Any suggestions? I feel like it's something basic i'm missing.