Ho provato a dichiarare il RNG = Range ("F" & Rows.Count).End(xlUp).Row ma mi da errore.
Grazie e buona giornata
- Codice: Seleziona tutto
Sub find_dups()
Dim rng as Range, c As Range, cella As Range, firstaddress, f As Long
set rng = [F1:F10]
For Each cella In rng
f = 0
If cella.Interior.ColorIndex <> 6 Then
With rng
Set c = .Find(cella, LookIn:=xlValues)
If Not c Is Nothing Then
f = f + 1
If f > 1 Then
firstaddress = c.Address
Do
c.Interior.ColorIndex = 6
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstaddress
End If
End If
End With
End If
Next
End Sub