Private Sub Worksheet_Calculate()
Dim T As Range, ordre%, cc%
Set T = ListObjects(1).DataBodyRange 'tableau structuré
Application.ScreenUpdating = False
Application.EnableEvents = False 'désactive les évènements
On Error Resume Next 'si aucune SpecialCell
ordre = IIf(T(1) < T(T.Rows.Count, 1), xlAscending, xlDescending)
cc = T.Columns.Count
With Workbooks.Add.Sheets(1) 'nouveau document
.[A:A].NumberFormat = "@" 'format Texte
.[A1].Resize(T.Rows.Count, cc) = T.Value
.[A:A].TextToColumns .Cells(1, cc + 1), xlDelimited, Other:=True, OtherChar:="." 'commande Convertir
.UsedRange.Columns(cc + 1).Resize(, .UsedRange.Columns.Count - cc).SpecialCells(xlCellTypeBlanks) = 0 'pour que le classement soit correct
.UsedRange.Sort .Columns(cc + 1), ordre, .Columns(cc + 2), , ordre, .Columns(cc + 3), ordre, Header:=xlNo 'tri sur 3 colonnes
T.Columns(1).NumberFormat = "@" 'format Texte
T = .[A1].Resize(T.Rows.Count, cc).Value 'restitution
T.Columns(1).NumberFormat = "General" 'format Standard
.Parent.Close False 'ferme le document
End With
Application.EnableEvents = True 'réactive les évènements
Application.ScreenUpdating = True
End Sub