Share via


Row Object

Multiple objects
Row
Multiple objects

Represents a row in a table. The Row object is a member of the Rows collection. The Rows collection includes all the rows in the specified selection, range, or table.

Using the Row Object

Use Rows(index), where index is the index number, to return a single Row object. The index number represents the position of the row in the selection, range, or table. The following example deletes the first row in the first table in the active document.

ActiveDocument.Tables(1).Rows(1).Delete

Use the Add method to add a row to a table. The following example inserts a row before the first row in the selection.

If Selection.Information(wdWithInTable) = True Then
    Selection.Rows.Add BeforeRow:=Selection.Rows(1)
End If

Remarks

Use the Cells property to modify the individual cells in a Row object. The following example adds a table to the selection and then inserts numbers into each cell in the second row of the table.

Selection.Collapse Direction:=wdCollapseEnd
If Selection.Information(wdWithInTable) = False Then
    Set myTable = _
        ActiveDocument.Tables.Add(Range:=Selection.Range, _
        NumRows:=3, NumColumns:=5)
    For Each aCell In myTable.Rows(2).Cells
        i = i + 1
        aCell.Range.Text = i
    Next aCell
End If

Properties | Alignment Property | AllowBreakAcrossPages Property | Application Property | Borders Property | Cells Property | Creator Property | HeadingFormat Property | Height Property | HeightRule Property | ID Property | Index Property | IsFirst Property | IsLast Property | LeftIndent Property | NestingLevel Property | Next Property | Parent Property | Previous Property | Range Property | Shading Property | SpaceBetweenColumns Property

Methods | ConvertToText Method | Delete Method | Select Method | SetHeight Method | SetLeftIndent Method

Parent Objects | Cell Object | Row Object | Rows Collection

Child Objects | Borders Object | Cells Object | Range Object | Row Object | Shading Object

See Also | Cell Object | Column Object | Error Accessing a Table Row or Column