Bonjour
j'ai un code qui marche bien avec des colonnes ayant au moins des lettres dans les cellules mais quand c'est seulement des chiffres le code sur le doublon ne marche pas .
voici le fichier joint
franchement là je suis a court d'idée.
merci pour votre aide
j'ai un code qui marche bien avec des colonnes ayant au moins des lettres dans les cellules mais quand c'est seulement des chiffres le code sur le doublon ne marche pas .
voici le fichier joint
Code:
Sub aff_Doublons_2col_con()
'etape1
Set d1 = CreateObject("Scripting.Dictionary")
Set d2 = CreateObject("Scripting.Dictionary")
Set plageA = Range("b2", [b65000].End(xlUp))
'Sheets("volt").
Set plageI = Range("j2", [j65000].End(xlUp))
[g:h].Interior.ColorIndex = xlNone
[g:h].EntireColumn.ClearContents
For Each c In plageA
If c <> "" Then d1(c.Value) = ""
Next c
For Each c In plageI
If d1.exists(c.Value) Then c.Interior.ColorIndex = 3
If c <> "" Then
d2(c.Value) = ""
End If
If Not d1.exists(c.Value) Then
j = j + 1
If Len(c.Text) > 0 Then Cells(j, c.Column - 3).Value = c.Value
'remplir colonne j
End If
Next c
For Each c In plageA
If d2.exists(c.Value) Then c.Interior.ColorIndex = 4
Next c
Range("h3", [k65000].End(xlUp)).Sort Key1:=Range("h2"), Order1:=xlAscending
End Sub
merci pour votre aide