View Single Post
 
Old 06-18-2016, 01:23 PM
KunleExcel KunleExcel is offline Windows 8 Office 2010 32bit
Novice
 
Join Date: Jun 2016
Location: Nigeria
Posts: 17
KunleExcel is on a distinguished road
Default Mark Duplicates

This one makes distinction between smith and Smith
Sub MarkDups()
Dim SRange As Range
Set SRange = Range("A1", Range("A1").End(xlToRight))

Dim c As Range
For Each c In SRange
Set c = SRange.Find(c, , , xlWhole, , , True)
If Not c Is Nothing Then
Dim firstAddress As String
firstAddress = c.Address
Do
Set c = SRange.FindNext(c)
If c.Address <> firstAddress Then
c.Font.Color = vbRed
End If
Loop While Not c Is Nothing And c.Address <> firstAddress

End If
Next c
End Sub
Reply With Quote