Sub SupprimeSansDoublons()
Dim lig As Long, plage As Range
Application.ScreenUpdating = False
Rows("1:" & Range("L65536").End(xlUp).Row).Sort Key1:=Range("L1"), Order1:=xlAscending, Header:=xlYes
For lig = 2 To Range("L65536").End(xlUp).Row
If Cells(lig, "L") <> Cells(lig - 1, "L") And Cells(lig, "L") <> Cells(lig + 1, "L") _
Then Cells(lig, "W") = "X" 'repérage des lignes à supprimer
Next
On Error Resume Next
Set plage = Columns("W").SpecialCells(xlCellTypeConstants).EntireRow
plage.Copy Sheets("Feuil1").Rows(Sheets("Feuil1").Range("L65536").End(xlUp).Row + 1) 'sauvegarde en Feuil1
plage.Delete
End Sub
Sub SupprimeDoublons()
Dim lig As Long
Application.ScreenUpdating = False
Rows("1:" & Range("L65536").End(xlUp).Row).Sort Key1:=Range("L1"), Order1:=xlAscending, Header:=xlYes
For lig = Range("L65536").End(xlUp).Row To 3 Step -1
If Cells(lig, "L") = Cells(lig - 1, "L") Then
Cells(lig - 1, 1).Resize(, 22) = Cells(lig, 1).Resize(, 22).Value 'copie ligne inférieure sur ligne supérieure, colonnes A:V
Cells(lig, "W") = "X" 'repérage des lignes à supprimer
End If
Next
On Error Resume Next
Columns("W").SpecialCells(xlCellTypeConstants).EntireRow.Delete
End Sub