Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim ws As Worksheet
Dim lo As ListObject
Dim Nom As Variant
' tri des deux tableaux
For Each Nom In Array("DDP", "CSF")
Set ws = ThisWorkbook.Sheets(Nom)
Set lo = ws.ListObjects(Nom)
With lo.Sort
With .SortFields
.Clear
.Add Key:=lo.ListColumns(1).Range, SortOn:=xlSortOnValues, _
Order:=xlAscending, DataOption:=xlSortTextAsNumbers
End With
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Next
ActiveWorkbook.Save
End Sub