Bonjour,
Key:= Cells(6, 5)
.SetRange .Range(.Cells(6, 1), .Cells(6, 50000))
il y mois de risque d'erreur comme ceci:
LastRw = Cells(Rows.Count, 1).End(xlUp).Row
Range(Cells(5, 1).Address, Cells(LastRw, 6).Address).Select
With ActiveWorkbook.Worksheets(ActiveSheet.Name).Sort
.SortFields.Clear
.SortFields.Add Key:=Range(Cells(5, 5).Address), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SetRange Range(Cells(5, 1).Address, Cells(LastRw, 6).Address)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With