recherche doublon qui ne marche pas sur des chiffres

bigs32

XLDnaute Junior
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
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
franchement là je suis a court d'idée.
merci pour votre aide
 

Pièces jointes

  • Classeur3.xlsm
    21.6 KB · Affichages: 36

Paritec

XLDnaute Barbatruc
Bonsoir Big32 le forum
la correction c'est de dire que tu fais du multi postage sur différents forum !!!:mad:

Bonsoir Alex3232 le forum
ton, fichier en retour
Si tu veux comparer des choux et des carottes ce n'est pas pareil
a+
Papou
 

Pièces jointes

  • Alex3232 V1.xlsm
    21.2 KB · Affichages: 27

Discussions similaires

Statistiques des forums

Discussions
312 379
Messages
2 087 767
Membres
103 662
dernier inscrit
rterterert