Shapes.AddTable method (PowerPoint)

Adds a table shape to a slide.

Syntax

expression. AddTable( _NumRows_, _NumColumns_, _Left_, _Top_, _Width_, _Height_ )

expression A variable that represents a Shapes object.

Parameters

Name Required/Optional Data type Description
NumRows Required Long The number of rows in the table.
NumColumns Required Long The number of columns in the table.
Left Optional Single The distance (in points) from the left edge of the slide to the left edge of the table.
Top Optional Single The distance (in points) from the top edge of the slide to the top edge of the table.
Width Optional Single The width (in points) of the new table.
Height Optional Single The height (in points) of the new table.

Return value

Shape

Example

This example creates a new table on slide two of the active presentation. The table has three rows and four columns. It's 10 points from the left edge of the slide, and 10 points from the top edge. The width of the new table is 288 points, which makes each of the four columns one inch wide (there are 72 points per inch). The height is set to 216 points, which makes each of the three rows one inch tall.

ActivePresentation.Slides(2).Shapes.AddTable(3, 4, 10, 10, 288, 216)

See also

Shapes Object

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.