une proposition de correction
Sub tri()
For Each ws In Worksheets
With ws
dl = .Cells(Rows.Count, 1).End(xlUp).Row
dc = .Cells(3, Columns.Count).End(xlToLeft).Column
.Range(.Cells(5, 1), .Cells(dl, dc)).Sort key1:=.Cells(5, 1), Order1:=xlAscending, Header:=xlNo, Orientation:=xlSortColumns
.Range(.Cells(2, 2), .Cells(dl, dc - 1)).Sort key1:=.Cells(4, 2), Order1:=xlAscending, Header:=xlNo, Orientation:=xlSortRows
End With
Next
End Sub