Bonjour,
Petit soucis dans l'utilisation des dictionnaires.
Mon code est sensé passer en revue 3 colonnes de valeurs et d'identifier les doublons pour les traiter ensuite. Je n'ai pas d'erreur mais il ne trouve aucun doublon alors qu'il y en a
Merci d'avance ...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 Sub TrouveDoublon(lig) ReDim element(nbnodes) As Variant Dim tab1, elm Set tab1 = CreateObject("Scripting.Dictionary") For col = 1 To 3 For Compteur = 1 To col1 elm = CStr(Cells(Compteur, 2 * col + 1)) If elm <> "" Then If tab1.exists(elm) Then traiter_doublons elm Cells(Compteur, 2 * col + 1).Interior.ColorIndex = 4 Else: stocker_elm elm, el, lig End If Else End If Next Next End Sub
Partager