Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [J1]) Is Nothing Then Exit Sub
Dim P As Range
Application.ScreenUpdating = False
With [A1].CurrentRegion
.AutoFilter 1, [J1] 'filtre automatique
Set P = .Offset(1).SpecialCells(xlCellTypeVisible)
.AutoFilter
Set P = Intersect(P, .Columns(2).Resize(, 2))
End With
With [J3].Resize(Rows.Count - 2, 2)
.Clear 'RAZ
If P Is Nothing Then Exit Sub
P.Copy .Cells(1) 'copier-coller
.RemoveDuplicates Array(1, 2), Header:=xlNo 'supprime les lignes doublons
.Sort .Cells(1, 2), xlDescending, .Cells(1), , xlAscending, Header:=xlNo 'tri sur 2 colonnes
End With
[J6].Resize(Rows.Count - 5, 2).Clear 'garde les 3 premiers
End Sub