单元格. Split 方法 (Word)Cells.Split method (Word)

拆分表格单元格范围。Splits a range of table cells.

语法Syntax

表达式拆分(NumRowsNumColumnsMergeBeforeSplit)expression.Split (NumRows, NumColumns, MergeBeforeSplit)

expression 是必需的。expression Required. 一个代表 "Cells" 集合的变量。A variable that represents a 'Cells' collection.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
NumRowsNumRows 可选Optional VariantVariant 一个单元格或多个单元格拆分成的行数。The number of rows that the cell or group of cells is to be split into.
NumColumnsNumColumns 可选Optional VariantVariant 一个单元格或多个单元格拆分成的列数。The number of columns that the cell or group of cells is to be split into.
MergeBeforeSplitMergeBeforeSplit 可选Optional VariantVariant
如果该参数值为 **True**,则在拆分多个单元格前会将它们相互合并。True to merge the cells with one another before splitting them.

示例Example

以下示例首先将选定单元格合并为一个单元格,然后将该单元格拆分为同一行中的三个单元格。This example merges the selected cells into a single cell and then splits the cell into three cells in the same row.

If Selection.Information(wdWithInTable) = True Then 
 Selection.Cells.Split NumRows:=1, NumColumns:=3, _ 
 MergeBeforeSplit:= True 
End If

另请参阅See also

单元格集合对象Cells Collection Object

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.