Sub Tri()
Dim derlig&, col%, derval As Variant
derlig = Application.Match("zzz", [A:A])
If derlig < 4 Then Exit Sub 'si le tableau est vide
If FilterMode Then ShowAllData 'si la feuille est filtrée
col = Rows("4:" & derlig).Find("*", , xlValues, , xlByColumns, xlPrevious).Column
With Cells(4, col).Resize(derlig - 3)
derval = .Find("*", , , , , xlPrevious)
.EntireRow.Sort .Cells, IIf(.Cells(1) > derval, xlAscending, xlDescending), Header:=xlNo 'tri
End With
End Sub