Bonjour,
Un exemple à adapter.
Les données sont sous de tableaux structurés.
Cdlt
Public Sub AppendTables()
Dim ws As Worksheet
Dim lo As ListObject, lo2 As ListObject
Dim r As Range
Dim n As Long, n2 As Long
Set lo2 = Range("Append").ListObject
With lo2
If Not .DataBodyRange Is Nothing Then .DataBodyRange.Delete
Set r = .InsertRowRange.Cells(1)
End With
For Each ws In ActiveWorkbook.Worksheets
Select Case ws.Name
Case "Append":
Case Else:
For Each lo In ws.ListObjects
Set lo = ws.ListObjects(1)
If Not lo.DataBodyRange Is Nothing Then
lo.DataBodyRange.Copy Destination:=r
Set r = lo2.HeaderRowRange.Cells(1).Offset(lo2.ListRows.Count + 1)
n = n + lo.ListRows.Count
End If
Next lo
End Select
Next ws
With lo2
.HeaderRowRange.EntireColumn.AutoFit
n2 = .ListRows.Count
End With
If n <> n2 Then MsgBox "Une erreur s'est produite !...", 64, "Information"
End Sub