Sub Ajouter_trier()
Dim f As Worksheet
Set f = Sheets("Donnée")
On Error Resume Next 'si la feuille n'existe pas
With Sheets(f.[B7].Value)
.Cells(Rows.Count, 1).End(xlUp)(2).Resize(, 7) = f.[A2:G2].Value
With .ListObjects(1).Range 'tableau structuré
.Sort .Cells(1), xlAscending, Header:=xlYes
.Cells(2, 8) = "=IF(A3="""","""",N(H2)+G3-F3)" 'sécurité, formule en colonne H
End With
End With
f.[B7,B10,D10,B14,D14,F14,B18,D18] = Empty
End Sub