Class Cell (PowerPoint VBA)

The class Cell represents a table cell. The Cell object is a member of the CellRange collection. The CellRange collection represents all the cells in the specified column or row. To use the CellRange collection, use the Cells keyword.

The main procedure of class Cell is Select

Set

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

Dim cll as Cell
Set cll = Dim lngRow As Long: lngRow = 
Dim lngColumn As Long: lngColumn = 
ActiveWindow.RangeFromPoint.Table.Cell(Row:=lngRow, Column:=lngColumn)

The following procedures can be used to set variables of type Cell: CellRange.Item, Table.Cell, Column.Cells and Row.Cells

Themes

The following procedures in this class have been grouped together and are described on a separate theme page

Sort/Order with its procedures Borders and CellRange.Borders

Methods

This is the main method of the Cell class

Select - Selects the specified object.

ActivePresentation.Slides(1).Shapes(2).Table.Cell.Select

Other Methods

Split - Splits a single table cell into multiple cells.

Dim lngNumRows As Long: lngNumRows = 
Dim lngNumColumns As Long: lngNumColumns = 
ActivePresentation.Slides(1).Shapes(2).Table.Cell(1,1).Split NumRows:=lngNumRows, NumColumns:=lngNumColumns

Properties

Parent returns the parent object for the specified object.

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

Selected returns True if the specified table cell is selected.

Dim booSelected As Boolean
booSelected = ActivePresentation.Slides(1).Shapes(2).Table.Cell.Selected

Shape returns a Shape object that represents a shape in a table cell.

Dim shpShape As Shape
Set shpShape = ActivePresentation.Slides(1).Shapes(2).Table.Cell.Shape

CellRange.Count returns the number of objects in the specified collection.

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

CellRange.Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActiveWindow.RangeFromPoint.Table.Rows(1).Cells.Parent