1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Function doublons_couleur_groupe_plage(lettre_colonne_voulue As String)
Dim couleurs() As Variant
Dim mondico As Object
Dim c As Variant
Dim nocoul As Variant
couleurs = Array(1, 3, 4, 6, 7, 8, 14, 15, 17, 20, 22, 24, 26, 27, 28, 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 50, 53)
Set mondico = CreateObject("Scripting.Dictionary")
For Each c In Range(lettre_colonne_voulue & 2, lettre_colonne_voulue & LastLignUsedInColumn(lettre_colonne_voulue))
If c <> "" Then mondico.item(c.value) = mondico.item(c.value) + 1
Next c
For Each c In Range(lettre_colonne_voulue & 2, lettre_colonne_voulue & LastLignUsedInColumn(lettre_colonne_voulue))
If c <> "" Then
nocoul = (Application.Match(c.value, mondico.keys, 0)) Mod UBound(couleurs)
If mondico.item(c.value) > 1 Then c.Interior.ColorIndex = couleurs(nocoul)
End If
Next c
End Function |
Partager