Table object (PowerPoint)

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.

Example

Use Shapes (index), where index is a number, to return a shape containing a table. Use the HasTableproperty to see if a shape contains a table. This example walks through the shapes on slide one, checks to see if each shape has a table, and then sets the mouse click action for each table shape to advance to the next slide.

With ActivePresentation.Slides(2).Shapes

    For i = 1 To .Count

        If .Item(i).HasTable Then

            .Item(i).ActionSettings(ppMouseClick) _

                .Action = ppActionNextSlide

        End If

    Next

End With

Use the Cellmethod of the Table object to access the contents of each cell. This example inserts the text "Cell 1" in the first cell of the table in shape five on slide three.

ActivePresentation.Slides(3).Shapes(5).Table _

    .Cell(1, 1).Shape.TextFrame.TextRange _

    .Text = "Cell 1"

Use the AddTablemethod to add a table to a slide. This example adds a 3x3 table on slide two in the active presentation.

ActivePresentation.Slides(2).Shapes.AddTable(3, 3)

Methods

Name
ApplyStyle
Cell
ScaleProportionally

Properties

Name
AlternativeText
Application
Background
Columns
FirstCol
FirstRow
HorizBanding
LastCol
LastRow
Parent
Rows
Style
TableDirection
Title
VertBanding

See also

PowerPoint Object Model Reference

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.