Columns.Add Method (Word)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Returns a Column object that represents a column added to a table.

expression .Add(BeforeColumn)

expression Required. A variable that represents a Columns collection.

Parameters

Name

Required/Optional

Data Type

Description

BeforeColumn

Optional

Variant

A Column object that represents the column that will appear immediately to the right of the new column.

Return Value

Column

This example creates a table with two columns and two rows in the active document and then adds another column before the first column. The width of the new column is set at 1.5 inches.

Sub AddATable() 
 Dim myTable As Table 
 Dim newCol As Column 
 
 Set myTable = ActiveDocument.Tables.Add(Selection.Range, 2, 2) 
 Set newCol = myTable.Columns.Add(BeforeColumn:=myTable.Columns(1)) 
 newCol.SetWidth ColumnWidth:=InchesToPoints(1.5), _ 
 RulerStyle:=wdAdjustNone 
End Sub
Show: