Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [A1:B1]) Is Nothing Then Exit Sub
Dim h As Long, col As Variant
Application.ScreenUpdating = False
Rows("2:" & Rows.Count).Delete 'RAZ
With Feuil1 'CodeName de la feuille "BASE"
h = .Range("AE" & Rows.Count).End(xlUp).Row - 7
If h < 1 Then Exit Sub 'sécurité
.[AE8].Resize(h).Copy [A2] 'pour copier aussi les formats
col = Application.Match([B1], [Liste2], 0)
If IsNumeric(col) Then [B2].Resize(h) = [Liste2].Cells(2, col).Resize(h).Value
[AA2].Resize(h) = .[BD8].Resize(h).Value
End With
[AB2].Resize(h).FormulaR1C1 = "=LN(AND(RC[-1]=R1C1,RC2=R1C2))"
[AB2].Resize(h) = [AB2].Resize(h).Value 'suppression des formules
[A2:AB2].Resize(h).Sort [AB2], xlAscending, Header:=xlNo 'tri pour accélérer la suppression
On Error Resume Next 's'il n'y a pas de valeurs d'erreur
[AB2].Resize(h).SpecialCells(xlCellTypeConstants, 16).EntireRow.Delete
[AA:AB].ClearContents
End Sub