This seems incredibly simple, but the comparative operator, Not Equal sign "<>" doesn't work because it really reads as "Less and greater". See below:
Column A, I have numeric value from 1 to 10
Column B, I have 1,3,5,7,9
A B
1 1
2 3
3 5
4 7
5 9
6
7
8
9
10
I want to compare column A to Column B and highlight all the unmatched numbers in column A, in this example, it would be 2,4,6,8,10.
The result should be as follows:
A B
1 1
2 3
3 5
4 7
5 9
6
7
8
9
10
and hopefully have the unmatched items listed in column D.
D
2
4
6
8
10
Here's my code:
Sub Unmatched()
For i = 1 To 10
For j = 1 To 5
newList = ""
If Cells(i, "A").Value <> Cells(j, "B").Value Then
Cells(i, "A").Interior.Color = RGB(0, 255, 0)
End If
Next j
Next i
End Sub
Column A, I have numeric value from 1 to 10
Column B, I have 1,3,5,7,9
A B
1 1
2 3
3 5
4 7
5 9
6
7
8
9
10
I want to compare column A to Column B and highlight all the unmatched numbers in column A, in this example, it would be 2,4,6,8,10.
The result should be as follows:
A B
1 1
2 3
3 5
4 7
5 9
6
7
8
9
10
and hopefully have the unmatched items listed in column D.
D
2
4
6
8
10
Here's my code:
Sub Unmatched()
For i = 1 To 10
For j = 1 To 5
newList = ""
If Cells(i, "A").Value <> Cells(j, "B").Value Then
Cells(i, "A").Interior.Color = RGB(0, 255, 0)
End If
Next j
Next i
End Sub