Hello
I have found code that identifies a duplicate in a single column . Instead of writing " duplicate' in column 2 when duplicate found I would like the identified duplicate higlighted in yellow in column 1
Newbee to vba got FALSE as value and compiling error
Can someone assist
I have found code that identifies a duplicate in a single column . Instead of writing " duplicate' in column 2 when duplicate found I would like the identified duplicate higlighted in yellow in column 1
Newbee to vba got FALSE as value and compiling error
Can someone assist
VBA Code:
Sub sbFindDuplicatesInColumn()
Dim lastRow As Long
Dim matchFoundIndex As Long
Dim iCntr As Long
lastRow = Range("A65000").End(xlUp).Row
For iCntr = 1 To lastRow
If Cells(iCntr, 1) <> "" Then
matchFoundIndex = WorksheetFunction.Match(Cells(iCntr, 1), Range("A1:A" & lastRow), 0)
If iCntr <> matchFoundIndex Then
Cells(iCntr, 2) = "Duplicate"
End If
End If
Next
End Sub