VBA, Word Table Insert/Remove Rows/Columns

In this article I will explain how you can add and delete rows and columns from tables in a word document using VBA.

Every word document has a Tables collection The first step in working with a table in VBA for word is to determine the table index. Tables in a word document start from the index “1” and go up. So for example the first table would be referenced by using the statement below:


 The second table would be reference by using:


 and so on . . .

All examples in this article will use the table below as their initial table:

Word, Table Initial


Delete Row:

The code below will remove the second row of the first table:



Word VBA, Delete Row

Delete Column:

The code below will remove the second column of the first table:



Word VBA Delete Column

Insert Row:

The codes below will all insert an empty row after the first row:

Tables.Item(1).Rows.Add (Tables.Item(1).Rows.Item(2))

Selection.InsertRowsBelow (1)

Selection.InsertRowsAbove (1)

The Rows.Add gets as input a row object. The new row will be inserted before the input row. The function Selection.InsertRowsBelow inserts as many rows passed as the input parameter below the currently selected row.


Word VBA Delete Row Result

Insert Columns:

I find the column insertion methods a bit awkward. While there were 3 methods for inserting rows there are only 2 methods for inserting columns:



The first method inserts a column to the right of the selected column. The second inserts a column to the left of the selected column.

Word VBA insert column

You can download the file and code related to this article from the link below:

See also:

If you need assistance with your code, or you are looking for a VBA programmer to hire feel free to contact me. Also please visit my website  www.software-solutions-online.com

3 thoughts on “VBA, Word Table Insert/Remove Rows/Columns”

Leave a Reply

Your email address will not be published. Required fields are marked *