Sub CouleurDoublons()
Dim Rng As Range, Cell As Range, coul&, dicocel As Object, dicocoul As Object
Randomize
Set Rng = Range("C5:C15")
Set dicocel = CreateObject("scripting.dictionary")
Set dicocoul = CreateObject("scripting.dictionary")
For Each Cell In Rng.Cells
If Not dicocel.exists(Cell.Value) Then
re:
coul = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
If Not dicocoul.exists(coul) Then dicocoul(coul) = "" Else GoTo re
dicocel(Cell.Value) = coul
Cell.Interior.Color = coul
Else
Cell.Interior.Color = dicocel(Cell.Value)
End If
Next
End Sub