Gary
You will find what you need at :-
http://www.cpearson.com/excel/duplicat.htm#InOneNotOther
Celia
Hi gary
Try something like this;
Dim OrgRg
Dim ToCompRg
Dim x As Integer
Dim oCell
Dim cCell
Sub Compare1()
'set orginal range to compare
Range("A1").Select
Set OrgRg = Range(ActiveCell, ActiveCell.End(xlDown))
'Reset Colors
OrgRg.Interior.ColorIndex = xlNone
OrgRg.Font.ColorIndex = 0
'set other data to compare range
Range("B1").Activate
Set ToCompRg = Range(ActiveCell, ActiveCell.End(xlDown))
Application.ScreenUpdating = False
'Compare NOW
For Each oCell In OrgRg
For Each cCell In ToCompRg
If oCell = cCell Then
'MsgBox oCell.Text & ":" & cCell
With oCell.Interior
.ColorIndex = 15 'Grey
.Pattern = xlSolid
End With
oCell.Font.ColorIndex = 5 'Blue
End If
Next cCell
Next oCell
Application.ScreenUpdating = True
MsgBox "Completed comparison"
End Sub
This assumes your data is continuous in column
A & B and highlights the cells in A that are the same.
Ivan
Thank you very much. This was very helpful