ListColumns.Add method (Excel)

Adds a new column to the list object.

Syntax

expression.Add (Position)

expression A variable that represents a ListColumns object.

Parameters

Name Required/Optional Data type Description
Position Optional Variant Integer. Specifies the relative position of the new column that starts at 1. The previous column at this position is shifted outward.

Return value

A ListColumn object that represents the new column.

Remarks

If Position is not specified, a new rightmost column is added. A name for the column is automatically generated. The name of the new column can be changed after the column is added.

Example

The following example adds a new column to the default ListObject object in the first worksheet of the workbook. Because no position is specified, a new rightmost column is added.

Set myNewColumn = ActiveWorkbook.Worksheets(1).ListObjects(1).ListColumns.Add

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.