Class Columns (PowerPoint VBA)

A collection of Column objects that represent the columns in a table. To use a Columns class variable it first needs to be instantiated, for example


Dim clms as Columns
Set clms = ActiveWindow.RangeFromPoint.Table.Columns

Add

Adds a new column to an existing table. Returns a Column object that represents the new table column.

The value of the BeforeColumn parameter must be between 1 and the number of columns in the table, inclusive. The default value is -1, which means that if you omit the BeforeColumn parameter, the new column is added as the last column in the table.

Add (BeforeColumn)

BeforeColumn: The index number that specifies the table column before which the new column will be inserted.


Dim clm As Column
Set clm = ActiveWindow.RangeFromPoint.Table.Columns.Add()

Count

Returns the number of objects in the specified collection.


Dim lngCount As Long
lngCount = ActivePresentation.Slides(1).Shapes(2).Table.Columns.Count

Item

Returns a single Column object from the specified Columns collection.

Item (Index)

Index: The index number of the single Column object in the collection to be returned.


Dim clm As Column
Set clm = ActiveWindow.RangeFromPoint.Table.Columns(Index:=1)