# VBA Add Column to Table in Excel VBA Add Column to Table in Excel. We can add a single Column or multiple Columns and data to table. Default new Columns added at the end of the table. In this tutorial we have explained multiple examples with explanation. We also shown example output screenshots. We have specified three examples in the following tutorial. You can change table and sheet name as per your requirement. We also specified step by step instructions how to run VBA macro code at the end of the session.

## Syntax to Add Column to Table using VBA in Excel

Here is the syntax to add new Column to table on the worksheet using VBA in Excel.

```expression.Add(Position, AlwaysInsert)
```

Where expression represents the ListColumns.
Position is an optional parameter. It represents the relative position of the new Column. Accepts the Integer value.
AlwaysInsert is an optional parameter. It represents the cells to be shifted to down or not, based on Boolean value. Accepts the Boolean value either True or False.

Note: If position is not specified, default adds new Column at the end of the table.

### Example to Add New Column to Table on the Worksheet

Let us see the example to add new column to table on the worksheet. The sheet name defined as ‘Table‘. And we use table name as ‘MyDynamicTable‘. You can change these two as per your requirement. We Add method of the ListObject object.

```'Add Column to Table in Excel VBA

'Declare Variables
Dim oSheetName As Worksheet
Dim sTableName As String
Dim loTable As ListObject

'Define Variable
sTableName = "MyDynamicTable"

'Define WorkSheet object
Set oSheetName = Sheets("Table")

'Define Table Object
Set loTable = oSheetName.ListObjects(sTableName)

End Sub
```

Output: Here is the following output screenshot of above example macro VBA code. ### Add Multiple Columns to Table in Excel using VBA

Here is another example to add multiple columns to table. In this example we add five(5) columns to the table. You can specify the number of columns count in the for loop.

``` 'VBA Add Multiple Columns to Table

'Declare Variables
Dim oSheetName As Worksheet
Dim sTableName As String
Dim loTable As ListObject
Dim iCnt As Integer

'Define Variable
sTableName = "MyDynamicTable"

'Define WorkSheet object
Set oSheetName = Sheets("Table")

'Define Table Object
Set loTable = oSheetName.ListObjects(sTableName)

For iCnt = 1 To 5
'Add multiple columns to the table
Next

End Sub
```

Output: Let us see the following output screenshot of above example macro VBA code. ### Add Column & Data to Table on the Worksheet in Excel

Let us see how to add new column and data to the table using VBA in Excel. In the below example we add new column and data of 5 columns.

``` 'VBA Add Column and Data to Table

'Declare Variables
Dim oSheetName As Worksheet
Dim sTableName As String
Dim loTable As ListObject
Dim lrColumn As ListColumn

'Define Variable
sTableName = "MyDynamicTable"

'Define WorkSheet object
Set oSheetName = Sheets("Table")

'Define Table Object
Set loTable = oSheetName.ListObjects(sTableName)

'Add New Column to the table

With lrColumn
'Ignore Range(1), because its header not a data range.
.Range(2) = 61
.Range(3) = 62
.Range(4) = 63
.Range(5) = 64
.Range(6) = 65
.Range(7) = 66
.Range(8) = 67
.Range(9) = 68
.Range(10) = 69
.Range(11) = 70
End With

End Sub
```

Output: Here is the following output screenshot of above example VBA macro code. #### Instructions to Run VBA Macro Code or Procedure:

You can refer the following link for the step by step instructions.

Instructions to run VBA Macro Code

#### Other Useful Resources:

Click on the following links of the useful resources. These helps to learn and gain more knowledge.
{"ft_lang_label":"__label__en","ft_lang_prob":0.6161727,"math_prob":0.71807605,"size":4014,"snap":"2022-27-2022-33","text_gpt3_token_len":931,"char_repetition_ratio":0.14264339,"word_repetition_ratio":0.1950078,"special_character_ratio":0.2157449,"punctuation_ratio":0.08951049,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99414766,"pos_list":[0,1,2,3,4,5,6,7,8],"im_url_duplicate_count":[null,null,null,2,null,2,null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-08-08T04:09:35Z\",\"WARC-Record-ID\":\"<urn:uuid:83e9fadb-619c-48b8-ad42-82154ed5542a>\",\"Content-Length\":\"95409\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7999d574-afa7-42fb-b0ba-dd18e57f77f4>\",\"WARC-Concurrent-To\":\"<urn:uuid:95fbe9af-6fdc-44f2-86d6-dfacb780f722>\",\"WARC-IP-Address\":\"162.159.134.42\",\"WARC-Target-URI\":\"https://vbaf1.com/table/add-column/\",\"WARC-Payload-Digest\":\"sha1:T3PSWXGL2OPELVMPPA22XVT6AGCBIQ4C\",\"WARC-Block-Digest\":\"sha1:73UC6C4BDEKC4HOK7CRPOEK7T2ANVP4G\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-33/CC-MAIN-2022-33_segments_1659882570765.6_warc_CC-MAIN-20220808031623-20220808061623-00640.warc.gz\"}"}