Rows [WksDocument]
Rows returns a range object containing one or more entire rows of cells. Returns a WksRange object.
Syntax
object.Rows( Row1, Row2 )
Parameter |
Type |
Required/ Optional |
Default |
Description |
Row1 |
Variant |
Required |
This provides first row number. The range may have a single row. |
|
Row2 |
Variant |
Optional |
This provides the last row number of the range. |
Remarks
See Specifying Cell Coordinates for more information on selecting cells.
Example
This example demonstrates how to change the cell color to green in rows A through C.
Wks.Rows(Row1:=1, Row2:=3).Format.BackColor = srfColorGreen
Example 2
This example demonstrates how to assign entire rows of cells to the variable named WksRange.
Dim WksRange As Object
Set WksRange = Wks.Rows(Row1:=1, Row2:=6)
Used by: WksDocument object