Bonjour,
Je relance ce sujet car il est extrêmement intéressant et très utile pour moi.
Je souhaite réaliser exactement ce qu'a demandé Solobomb, c'est à dire identifier si un contact est parti ou ses coordonées ont changé ou si il y a un nouveau contact dans ma liste.
Mon tableau comporte 8 colones au lieu de 6.
J'ai tenté de bidouiller le code moi-même pour réctifier le nombre de colonne et obtenir exactement la même chose mais hélas ça ne marche pas...
Je n'ai que la première ligne et elle est fausse puisque cette personne n'a pas changé.
Option Explicit
Option Base 1
Sub Progtest()
Dim i&, fin&, fin1&, fin3, a&, aa As Variant, bb As Variant, cc As Variant
fin = Feuil1.Range("A" & Rows.Count).End(xlUp).Row
fin1 = Sheets("Feuil2").Range("A" & Rows.Count).End(xlUp).Row
aa = Feuil1.Range("A2:J" & fin)
bb = Sheets("Feuil2").Range("A2:J" & fin)
fin3 = Sheets("Feuil3").Range("A" & Rows.Count).End(xlUp).Row
If fin3 < 2 Then fin3 = 2
Sheets("Feuil3").Range("A2:I" & fin3).Clear
For i = 1 To UBound(aa)
For a = 1 To 8
aa(i, 9) = aa(i, 9) & "#" & aa(i, a)
Next a
Next i
For i = 1 To UBound(bb)
For a = 1 To 8
bb(i, 9) = bb(i, 9) & "#" & bb(i, a)
Next a
Next i
For i = 1 To UBound(aa)
For a = 1 To UBound(bb)
If aa(i, 9) = bb(a, 9) Then aa(i, 10) = "Idem": bb(a, 10) = "Idem"
Next a
Next i
For i = 1 To UBound(aa)
aa(i, 9) = ""
For a = 1 To 2
aa(i, 9) = aa(i, 9) & "#" & aa(i, a)
Next a
Next i
For i = 1 To UBound(bb)
bb(i, 9) = ""
For a = 1 To 2
bb(i, 9) = bb(i, 9) & "#" & bb(i, a)
Next a
Next i
For i = 1 To UBound(aa)
For a = 1 To UBound(bb)
If aa(i, 9) = bb(a, 9) And bb(a, 10) = "" Then bb(a, 10) = "Changé": GoTo 1
If aa(i, 9) = bb(a, 9) And bb(a, 10) = "idem" Then GoTo 1
Next a
If aa(i, 10) = "" Then aa(i, 10) = "Parti"
If bb(i, 10) = "" Then bb(i, 10) = "Nouveau"
1 Next i
For i = 1 To UBound(aa)
If aa(i, 10) = "Idem" Or aa(i, 10) = "" Then
GoTo 2
Else:
fin = Sheets("Feuil3").Range("A" & Rows.Count).End(xlUp).Row + 1
For a = 1 To 8
Sheets("Feuil3").Cells(fin, a) = aa(i, a)
Next a
Sheets("Feuil3").Cells(fin, 9) = aa(i, 10)
End If
2 Next i
For i = 1 To UBound(bb)
If bb(i, 10) = "Idem" Then
GoTo 3
Else:
fin = Sheets("Feuil3").Range("A" & Rows.Count).End(xlUp).Row + 1
For a = 1 To 8
Sheets("Feuil3").Cells(fin, a) = bb(i, a)
Next a
Sheets("Feuil3").Cells(fin, 9) = bb(i, 10)
End If
3 Next i
End Sub
Merci à ceux qui pourront m'aider.
Cordialement,