Private Sub Worksheet_Change(ByVal Target As Range)
With [B5].CurrentRegion.Resize(, 9)
If Intersect(Target, Union([B2], .Cells)) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
If FilterMode Then ShowAllData 'si la feuille est filtrée
.Cells(2, 13).Resize(Rows.Count - .Row) = "" 'RAZ
If Int(Val([B2])) < 1 Then Exit Sub
With .Cells(2, 1).Resize(Int(Val([B2])))
.Columns(12) = .Columns(1).Value 'N° en colonne M
.Columns(13) = .Columns(10).Value 'copie les valeurs de la colonne K en colonne N
.Columns(12).Resize(, 2).Sort .Columns(13), xlDescending, Header:=xlNo 'tri sur la colonne N
.Columns(13) = .Columns(1).Value 'N° en colonne N indiquant le classement
.Columns(12).Resize(, 2).Sort .Columns(12), xlAscending, Header:=xlNo 'tri dans l'ordre initial
.Columns(12) = "" 'RAZ de la colonne M
End With
End With
End Sub