Bonjour,
Une autre proposition VBA.
Cdlt.
Public Sub CreateTable()
Dim tbl As Variant, arr() As Variant
Dim r As Range
Dim x As String, y As String
Dim lastRow As Long, I As Long, k As Long
With Worksheets("Table").ListObjects(1)
If Not .DataBodyRange Is Nothing Then .DataBodyRange.Delete
Set r = .InsertRowRange.Cells(1)
End With
With Worksheets("Export")
lastRow = .Cells(.Rows.Count, 2).End(xlUp).Row
tbl = .Cells(12, 1).Resize(lastRow - 12, 13)
End With
For I = 1 To UBound(tbl)
If tbl(I, 4) = "" Then
x = tbl(I, 1)
y = tbl(I, 2)
Else
If tbl(I, 1) <> "" Then
ReDim Preserve arr(10, k + 1)
arr(0, k) = x
arr(1, k) = y
arr(2, k) = tbl(I, 1)
arr(3, k) = tbl(I, 2)
arr(4, k) = tbl(I, 3)
arr(5, k) = tbl(I, 4)
arr(6, k) = tbl(I, 7)
arr(7, k) = tbl(I, 9)
arr(8, k) = tbl(I, 11)
arr(9, k) = tbl(I, 13)
k = k + 1
End If
End If
Next I
If k > 0 Then r.Resize(k, 10).Value = Application.Transpose(arr)
End Sub