I have found a macro that highlights duplicates
Public Sub MarkDuplicates()
Dim iWarnColor As Integer
Dim rng As Range
Dim rngCell As Variant
Set rng = Range("A1:A65000")
iWarnColor = xlThemeColorAccent2
For Each rngCell In rng.Cells
vVal = rngCell.Text
If (WorksheetFunction.CountIf(rng, vVal) = 1) Then
rngCell.Interior.Pattern = xlNone
Else
rngCell.Interior.ColorIndex = iWarnColor
End If
Next
End Sub
But I need it to highlight all the duplicates except for the first instance. Perhaps a better way is to highlight the first instance of a unique value instead?
Check the range above the current cell to see if the count is greater than 1, rather than checking the whole range.
This modification will run also only test rows with data, and not run though 65535 cells if it’s not actually filled with anything