Table of contents
TOC
折叠目录
展开目录

Table.Cells 属性 (发布服务器)Table.Cells Property (Publisher)

office 365 dev account|上次更新日期: 2018/3/13
|
3 参与人员

返回一个表示表格中的单元格区域的矩形对象。Returns a CellRange object that represents a range of cells in a table.

语法Syntax

表达式单元格( StartRowStartColumnEndRowEndColumn)expression. Cells( StartRow, StartColumn, EndRow, EndColumn)

_expression_A 表示一个对象的变量。_expression_A variable that represents a Table object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
StartRowStartRow可选OptionalLongLong起始单元格所在的行。如果省略此参数,区域将包含所有表格行。The row in which the starting cell exists. If this argument is omitted, all the table rows are included in the range.
StartColumnStartColumn可选OptionalLongLong起始单元格所在的列。如果省略此参数,区域将包含所有表格列。The column in which the starting cell exists. If this argument is omitted, all the table columns are included in the range.
EndRowEndRow可选OptionalLongLong终止单元格所在的行。如果省略此参数,则仅由StartRow指定的行包含在范围内。如果指定了此参数,但未指定StartRow ,则导致出错。The 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.
EndColumnEndColumn可选OptionalLongLong终止单元格所在的列。如果省略此参数,则只由StartColumn指定的列包括在范围内。如果指定了此参数,但未指定StartColumn ,则导致出错。The 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