Bonjour,
Doublons dans un champ
0,6s pour 25.000 lignes
Sub ColoriageDoublons3()
[A:A].Interior.ColorIndex = xlNone
a = Range("a1", [a65000].End(xlUp))
Set mondico = CreateObject("Scripting.Dictionary")
For Each c In a
mondico.Item(c) = mondico.Item(c) + 1
Next c
For Each c In Range("a2", [a65000].End(xlUp))
If mondico.Item(c.Value) > 1 Then c.Interior.ColorIndex = 4
Next c
End Sub
Doublons entre 2 champs
Sub DoublonsRapide()
Set d = CreateObject("Scripting.Dictionary")
Set d2 = CreateObject("Scripting.Dictionary")
Set plage1 = Range("B1", [b65000].End(xlUp))
Set plage2 = Range("C1", [c65000].End(xlUp))
[B:C].ClearComments
[B:C].Interior.ColorIndex = xlNone
For Each C In plage1
d.Item(C.Value) = ""
Next C
For Each C In plage2
d2.Item(C.Value) = ""
If d.exists(C.Value) Then C.Interior.ColorIndex = 3
Next C
For Each C In plage1
If d2.exists(C.Value) Then C.Interior.ColorIndex = 4
Next C
End Sub
Ceuzin