Re,
bon, j'ai cherché à faire apparaître la colonne supplémentaire dans le résultat en rajoutant la variable H, j'y suis presque sauf que les 2 premières lignes sont erronées.
voici le code modifié erroné :
Public Sub Create_table()
Dim tbl As Variant, arr() As Variant
Dim H As Long, I As Long, J As Long, k As Long
With Worksheets("Feuil1")
tbl = .Cells(1).CurrentRegion.Value
For H = 2 To UBound(tbl)
For J = 4 To UBound(tbl, 2)
If tbl(H, J) <> "" Then
ReDim Preserve arr(5, k + 1)
arr(0, k) = tbl(H, 1)
arr(1, k) = tbl(H, 2)
arr(2, k) = tbl(H, 3)
arr(3, k) = CLng(tbl(H, J))
arr(4, k) = tbl(1, H)
k = k + 1
End If
Next J
Next H
End With
With Worksheets("Feuil2")
With .ListObjects(1)
If Not .DataBodyRange Is Nothing Then .DataBodyRange.Delete
.InsertRowRange.Cells(1).Resize(k, 5).Value = Application.Transpose(arr)
End With
.Activate
End With
End Sub