Coller une variable tableau dans un tableau structuré

Bonjour,

Si j'ai une variable tableau (disons 100 lignes et 12 colonnes) = MonTab

J'ai un tableau structuré = range("TableauDonnees") dont la première colonne a une numérotation automatique par formule ...
( =LIGNE()-LIGNE(TableauDonnees[[#En-têtes];[NoAuto]]) ) ...

Est-ce possible de coller d'un coup MonTab dans le tableau structuré ou dois-je faire une boucle ?

Merci de votre expertise ...

ric

Bonjour,

Une proposition ?

Cdlt.

26ric.xlsm (16.73 Ko)
Public Sub Ric()
Dim lo As ListObject
Dim arr(1 To 100, 1 To 11)
Dim r As Range
Dim i As Long, j As Long
    Set lo = Range("Table1").ListObject
    With lo
        If Not .DataBodyRange Is Nothing Then .DataBodyRange.Delete
        Set r = .InsertRowRange.Cells(2)
    End With
    For i = 1 To 100
        For j = 1 To 11
            arr(i, j) = Int((50 * VBA.Rnd) + 1)
        Next j
    Next i
    r.Resize(100, 11).Value = arr
End Sub

Bonjour,

Donc des boucles > excellent ...

Merci énormément pour le cadeau ... ... > le code est fourni ...

ric

Rechercher des sujets similaires à "coller variable tableau structure"