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
| Sub doublon()
With ThisWorkbook.Worksheets("Feuil1")
For i = .Cells(.Rows.Count, 1).End(xlUp).Row To 2 Step -1
Tab1 = Split(Replace(.Cells(i, 1).Value, " ", ""), "-")
For j = i - 1 To 1 Step -1
Tab2 = Split(Replace(.Cells(j, 1).Value, " ", ""), "-")
If Identique(Tab1, Tab2) Then
.Rows(i).Delete
Exit For
End If
Next j
Next i
End With
End Sub
Function Identique(Tab1, Tab2) As Boolean
For i = LBound(Tab1) To UBound(Tab1)
For j = LBound(Tab2) To UBound(Tab2)
If Tab1(i) <> Tab2(j) Then
trouve = False
Else
trouve = True
Exit For
End If
Next j
If trouve = False Then Identique = trouve: Exit Function
Next i
Identique = trouve
End Function |
Partager