[COLOR="Blue"]Sub[/COLOR] AddToTable()
[COLOR="Blue"]Dim[/COLOR] i [COLOR="Blue"]As[/COLOR] [COLOR="Blue"]Integer[/COLOR]
[COLOR="Blue"]With[/COLOR] Range("Table1").ListObject
[COLOR="Blue"]For[/COLOR] i = 1 [COLOR="Blue"]To[/COLOR] 14
.ListRows.Add Position:=.ListRows.Count + 1
[COLOR="Blue"]Next[/COLOR]
[COLOR="Blue"]End[/COLOR] [COLOR="Blue"]With[/COLOR]
[COLOR="Blue"]End[/COLOR] [COLOR="Blue"]Sub[/COLOR]
Sub SelectingPartOfTable()
Dim oSh As Worksheet
Set oSh = ActiveSheet
'1: with the listobject
With oSh.ListObjects("Table1")
'Select entire table
.Range.Select
'Select just the data of the entire table
.DataBodyRange.Select
'Select third column
.ListColumns(3).Range.Select
End With
End Sub
Code:
[COLOR=blue]Sub[/COLOR] AddToTable()
[COLOR=blue]Dim[/COLOR] i [COLOR=blue]As[/COLOR] [COLOR=blue]Integer[/COLOR]
[COLOR=blue]With[/COLOR] Range("Table1").ListObject
[COLOR=blue]For[/COLOR] i = 1 [COLOR=blue]To[/COLOR] 14
.ListRows.Add Position:=.ListRows.Count + 1
[COLOR=blue]Next[/COLOR]
[COLOR=blue]End[/COLOR] [COLOR=blue]With[/COLOR]
[COLOR=blue]End[/COLOR] [COLOR=blue]Sub[/COLOR]
Code:[COLOR=blue]Sub[/COLOR] AddToTable() [COLOR=blue]Dim[/COLOR] i [COLOR=blue]As[/COLOR] [COLOR=blue]Integer[/COLOR] [COLOR=blue]With[/COLOR] Range("Table1").ListObject [COLOR=blue]For[/COLOR] i = 1 [COLOR=blue]To[/COLOR] 14 .ListRows.Add Position:=.ListRows.Count + 1 [COLOR=blue]Next[/COLOR] [COLOR=blue]End[/COLOR] [COLOR=blue]With[/COLOR] [COLOR=blue]End[/COLOR] [COLOR=blue]Sub[/COLOR]