Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15882

Multiple dynamic tables VBA

$
0
0
I am a beginner when it comes to VBA. I want to create as many dynamic table as a given value X. The tables should be created one near the other. Each row of the table should have at least a cell with text and a formula. This is what I have done already:

Private Sub CommandButton1_Click()

Dim t As ListObject

Dim c As Range


Sheet4.Activate

Set t = Sheet4.ListObjects.Add(xlSrcRange, Sheet4.Range("A2").Resize(37, 5), , xlNo)

t.ListColumns(1).Name = "Samples"

t.ListColumns(2).Name = "Activities"

t.ListColumns(3).Name = "Discipline"

t.ListColumns(4).Name = "Activity"

t.ListColumns(5).Name = "Duration(h)"

End Sub

I don't know how can I make the loop to put the tables on columns, not rows and how to add names and formulas in the table rows dynamically.

Viewing all articles
Browse latest Browse all 15882

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>