Re,
bien vu ^^s'était bien cela les Add (Add2 remplacer par Add tout simplement et cela deux fois dans la macro Loureed)^
Sub LouReeD()
Application.ScreenUpdating = False
Dim I, J, K
' on efface les tris
ActiveWorkbook.Worksheets("Feuil1").ListObjects("Tableau13").Sort.SortFields. _
Clear
' on tri la colonne Livré afin de mettre les "Oyi" en tête de tableau
ActiveWorkbook.Worksheets("Feuil1").ListObjects("Tableau13").Sort.SortFields. _
Add Key:=Range("Tableau13[[#All],[Livrée]]"), SortOn:=xlSortOnValues, _
Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Feuil1").ListObjects("Tableau13").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
' on compte le nombre de Oui = cellule non vide en colonne N
With ActiveSheet.ListObjects(1).DataBodyRange
I = 1
Do
If .Cells(I, 14) = "" Then Exit Do
I = I + 1
Loop
If I = 1 Then Exit Sub Else I = I - 1
' on copie les lignes
.Cells(1, 1).Resize(I, 14).Copy
' on recherche la dernière ligne du tableau de sauvegarde
K = Sheets("Feuil2").ListObjects(1).ListRows.Count
If K = 0 Then K = 2 Else K = K + 2
' on colle les données
Sheets("Feuil2").Range("A" & K).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End With
' on efface les lignes du tableau source
For J = 1 To I
ActiveSheet.ListObjects(1).ListRows(1).Delete
Next J
Application.CutCopyMode = False
' on retri le tableau par date de commande
ActiveWorkbook.Worksheets("Feuil1").ListObjects("Tableau13").Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets("Feuil1").ListObjects("Tableau13").Sort.SortFields. _
Add Key:=Range("Tableau13[[#All],[Date Commande]]"), SortOn:= _
xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Feuil1").ListObjects("Tableau13").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
merci @toi ^^