Sub tri()
With ActiveSheet
Select Case .Name
Case "Écuries"
Run_Tri .Range("D4"), .Range("C4:D13")
Case "Pilotes"
Run_Tri .Range("C5"), .Range("B5:C30")
Case Else
Run_Tri .Range("J4"), .Range("I4:J13")
Run_Tri .Range("O4"), .Range("N4:O23")
End Select
End With
End Sub
Sub Run_Tri(Nomkey, Rangefiltrée)
Application.ScreenUpdating = False
With ActiveSheet.Sort
.SortFields.Clear
.SortFields.Add Key:=Nomkey, Order:=xlDescending
.SetRange Rangefiltrée
.Apply
End With
Application.ScreenUpdating = True
End Sub