pascal21
XLDnaute Barbatruc
bonjour à tous
j'ai récupérer sur le site de boisgontier une macro qui permet de colorer les doublons de la colonne A
je cherche le code, qui me permettrait d'aller sur la 1ere cellule colorée par la macro (en partant du haut du tableau)
comment faire cela
merci
je vous mets le code
j'ai récupérer sur le site de boisgontier une macro qui permet de colorer les doublons de la colonne A
je cherche le code, qui me permettrait d'aller sur la 1ere cellule colorée par la macro (en partant du haut du tableau)
comment faire cela
merci
je vous mets le code
PHP:
Sub ColorerDoublons()
Dim plage As Range
Dim Cel As Range, Celbis As Range
Dim L As Integer, lig As Integer, N As Byte
Application.ScreenUpdating = False
L = Range("a2000").End(xlUp).Row
'effacement des couleurs
Set plage = Range("a1:a" & L)
plage.Interior.ColorIndex = xlNone
'Coloration des doublons
N = 2
For Each Cel In plage
lig = Cel.Row
If Application.CountIf(plage, Cel) > 1 Then
If Cel.Interior.ColorIndex = xlNone And Application.CountIf(Range("a1:a" & lig), Cel) = 1 Then
N = N + 1
Cel.Interior.ColorIndex = N
Else
For Each Celbis In plage
If Celbis = Cel And Celbis.Row <> Cel.Row Then
Cel.Interior.ColorIndex = Celbis.Interior.ColorIndex
End If
Next Celbis
End If
End If
Next Cel
Application.ScreenUpdating = True
''le code recherché serait à mettre ici
End Sub