Quote:
I want the rows and columns created to be apart of the table.
|
Sorry, that's not what I interpreted to be wanted. Simplifies things.
To add a row to the table (and set its height)
Code:
Private Sub CommandButton1_Click()
' add row to table
Dim oLo As ListObject
Set oLo = ActiveSheet.ListObjects(1) 'first table on sheet
With oLo
.ListRows.Add AlwaysInsert:=True
.Range.Rows(.Range.Rows.Count).RowHeight = 30
End With
End Sub
To add a column to the table (and set its width)
Code:
Private Sub CommandButton2_Click()
' add column to table
Dim oLo As ListObject
Set oLo = ActiveSheet.ListObjects(1) 'first table on sheet
With oLo
.ListColumns.Add
.ListColumns(.ListColumns.Count).Range.ColumnWidth = 24
End With
End Sub
Hope that rectifies things.
Good luck with the project.