Sub ColorDuplicates()
'Color duplicate items between columns A and B
For i = 1 To Range("B65536").End(xlUp).Row
If Application.WorksheetFunction.CountIf(Range("A:A"), Range("B" & i)) = 1 Then
With Range("B" & i).Font
.ColorIndex = 3
.Bold = True
End With
End If
Next i
For i = 1 To Range("A65536").End(xlUp).Row
If Application.WorksheetFunction.CountIf(Range("B:B"), Range("A" & i)) = 1 Then
With Range("A" & i).Font
.ColorIndex = 3
.Bold = True
End With
End If
Next i
End Sub
Have you tried regular expressions?
Could you use InStr?
http://msdn.microsoft.com/en-us/library/8460tsh1(v=vs.80).aspx
I've used that before to search for X in a range. If instr("name")>1 then ... etc.
Can you expound on this?