1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
Sub Rechercher_doublons()
Dim Val
Dim DerniereLigne
Dim depart
Dim i
' ouverture du fichier
Workbooks.Open Filename:="C:\Users\admin\Desktop\Dim\test1.xls"
MsgBox ("début de la boucle")
Application.DisplayAlerts = False
' Parcours de la boucle
i = 2
Do
DerniereLigne = Range("A1").End(xlDown).Row
val1 = "E" & i
depart = Range(val1).Value
'MsgBox (val1)
For j = 3 To DerniereLigne
Val = "E" & j
'MsgBox ("Range(val) vaut ") & Range(Val).Value
If depart = Range(Val).Value Then
ecrire_dans_Fichier (depart)
' supprimer ligne
Rows(j).Delete
ActiveWorkbook.Save
DerniereLigne = DerniereLigne - 1
i = i + 1
End If
Next j
Loop Until depart = ""
MsgBox ("fin de la boucle")
End Sub |
Partager