我找到了一个突出显示重复项的宏
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
但我需要它来突出显示除第一个实例之外的所有重复项。也许更好的方法是突出显示唯一值的第一个实例?