Class Table (PowerPoint VBA)

The class Table represents a table shape on a slide. The Table object is a member of the Shapes collection. The Table object contains the Columns collection and the Rows collection.


To use a Table class variable it first needs to be instantiated, for example

Dim tbl as Table
Set tbl = ActiveWindow.RangeFromPoint.Table

The following procedures can be used to set variables of type Table: Row.Parent, Shape.Table and ShapeRange.Table


Some procedures in this class have been grouped together in themes and are described on separate theme pages

Format with its procedures ApplyStyle and Style
Row with its procedures FirstRow, LastRow and Rows


Other Methods

Cell - Returns a Cell object that represents a cell in a table.

Dim lngRow As Long: lngRow = 2 
Dim lngColumn As Long: lngColumn = 3 
Dim cll As Cell
Set cll = ActivePresentation.Slides(1).Shapes(2).Table.Cell(Row:=lngRow, Column:=lngColumn)


AlternativeText returns or sets the alternative text associated with a shape in a Web presentation.

ActivePresentation.Slides(1).Shapes(2).Table.AlternativeText =

Background returns the TableBackground object associated with the specified table.

Dim tbdBackground As TableBackground
Set tbdBackground = ActiveWindow.RangeFromPoint.Table.Background

Columns returns a Columns collection that represents all the columns in a table.

Dim clmsColumns As Columns
Set clmsColumns = ActivePresentation.Slides(1).Shapes(2).Table.Columns

FirstCol determines whether to display special formatting for the first column of the specified table.

ActiveWindow.RangeFromPoint.Table.FirstCol = True

HorizBanding determines whether to display banded rows, in which even rows are formatted differently from odd rows.

ActiveWindow.RangeFromPoint.Table.HorizBanding = True

LastCol determines whether to display special formatting for the last column of the specified table.

ActiveWindow.RangeFromPoint.Table.LastCol = True

Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActiveWindow.RangeFromPoint.Table.Parent

TableDirection returns or sets the direction in which the table cells are ordered.

ActivePresentation.Slides(1).Shapes(2).Table.TableDirection = ppDirectionLeftToRight

Title returns or sets the title of the Table object.

ActiveWindow.RangeFromPoint.Table.Title =

VertBanding determines whether to display banded columns, in which even columns are formatted differently from odd columns.

ActiveWindow.RangeFromPoint.Table.VertBanding = True