Split Method

Applies To

Cell object, Cells collection object, Subdocument object, Table object.

Description

Cell object: Splits a single table cell into multiple cells.

Cells object: Splits a range of table cells.

Subdocument object: Divides an existing subdocument into two subdocuments at the same level in master document view or outline view. The division is at the beginning of the specified range. If the active document isn't in either master document or outline view, or if the range isn't at the beginning of a paragraph in a subdocument, an error occurs.

Table object: Inserts an empty paragraph immediately above the specified row in the table, and returns a Table object that contains both the specified row and the rows that follow it.

Syntax 1

expression.Split(NumRows, NumColumns)

Syntax 2

expression.Split(NumRows, NumColumns, MergeBeforeSplit)

Syntax 3

expression.Split(Range)

Syntax 4

expression.Split(BeforeRow)

expression Syntax 1: An expression that returns a Cell object.

Syntax 2: An expression that returns a Cells object.

Syntax 3: An expression that returns a Subdocument object.

Syntax 4: An expression that returns a Table object.

NumColumns Optional Variant. The number of columns that the cell or group of cells is to be split into.

NumRows Optional Variant. The number of rows that the cell or group of cells is to be split into.

MergeBeforeSplit Optional Variant. True to merge the cells with one another before splitting them.

Range Required Range object. The range that, when the subdocument is split, becomes a separate subdocument.

BeforeRow Required Variant. The row that the table is to be split before. Can be a row number or a Row object.

See Also

InsertBreak method, Split property, SplitTable method.

Example

This example creates a 5x5 table in the active document and splits it before the third row. Shading is applied to the cells in the resulting table (the new 3x5 table).

Set newDoc = Documents.Add
Set myTable = ActiveDocument.Tables.Add(Range:=Selection.Range, _
    NumColumns:=5, NumRows:=5)
myTable.Split(BeforeRow:=myTable.Rows(3)).Shading.Texture = wdTexture10Percent
This example splits the first cell in the first table into two cells.

ActiveDocument.Tables(1).Cell(1, 1).Split NumColumns:=2
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
This example splits the selection from an existing subdocument into a separate subdocument.

Selection.Range.Subdocuments(1).Split Range:=Selection.Range