1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Sub TrouveDoublon()
Dim Tableau() As TableauType
Dim Cellule, Haut, Bas, Compteur, C2
Colonne = 15
Haut = Selection.End(xlUp).Row
Bas = Selection.End(xlDown).Row
ReDim Tableau(Bas)
For Compteur = Haut To Bas
Tableau(Compteur).Contenu = Cells(Compteur, Colonne)
Tableau(Compteur).Coordonnee = Cells(Compteur, Colonne).Row
Next
For Compteur = Haut To Bas
For C2 = (Compteur + 1) To Bas
If Tableau(Compteur).Contenu = Tableau(C2).Contenu Then
Cells(Tableau(C2).Coordonnee, Colonne + 1).Value = 1
Cells(Tableau(C2).Coordonnee, Colonne - 13).Interior.ColorIndex = 6
Cells(Tableau(C2).Coordonnee, Colonne - 12).Interior.ColorIndex = 6
Cells(Tableau(C2).Coordonnee, Colonne - 11).Interior.ColorIndex = 6
Cells(Tableau(C2).Coordonnee, Colonne - 10).Interior.ColorIndex = 6
Cells(Tableau(C2).Coordonnee, Colonne - 9).Interior.ColorIndex = 6
End If
Next
Next
End Sub |
Partager