Sub Trier()
Dim t, ncol%, x$, i&, j%
Application.ScreenUpdating = False
On Error Resume Next 'si aucune SpecialCell
With [A3].CurrentRegion.Columns(2).Resize(, 4)
t = .Value 'tableau VBA, plus rapide
ncol = UBound(t, 2) - 1
x = t(2, 4)
For i = 2 To UBound(t)
For j = 1 To ncol
If t(i, j) = "" Then If t(i, 4) = x Then t(i, j) = "zzz" Else t(i, j) = "=R[-1]C"
Next j, i
.NumberFormat = "General" 'format Standard
.Resize(, 3).FormulaR1C1 = t 'restitution
.EntireRow.Sort .Columns(3), xlAscending, .Columns(1), , xlAscending, Header:=xlYes 'tri sur 2 colonnes
.SpecialCells(xlCellTypeFormulas).ClearContents 'efface les formules
.Replace "zzz", ""
.NumberFormat = "@" 'format Texte
End With
End Sub