Table of contents
TOC
Collapse the table of content
Expand the table of content

Table.Cells Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

Returns a CellRange object that represents a range of cells in a table.

Syntax

expression. Cells( StartRow, StartColumn, EndRow, EndColumn)

_expression_A variable that represents a Table object.

Parameters

NameRequired/OptionalData TypeDescription
StartRowOptionalLongThe row in which the starting cell exists. If this argument is omitted, all the table rows are included in the range.
StartColumnOptionalLongThe column in which the starting cell exists. If this argument is omitted, all the table columns are included in the range.
EndRowOptionalLongThe row in which the ending cell exists. If this argument is omitted, only the row specified by StartRow is included in the range. If this argument is specified but StartRow is omitted, an error occurs.
EndColumnOptionalLongThe column in which the ending cell exists. If this argument is omitted, only the column specified by StartColumn is included in the range. If this argument is specified but StartColumn is omitted, an error occurs.

Remarks

If all arguments are omitted, all the cells in the table are included in the range.

Example

This example merges the first two cells in the first two rows of the specified table.

Sub MergeCells() 
 ActiveDocument.Pages(1).Shapes(2).Table _ 
 .Cells(StartRow:=1, StartColumn:=1, _ 
 EndRow:=2, EndColumn:=2).Merge 
End Sub
© 2018 Microsoft