Rows Property
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Range object: Returns a Range object that represents all the rows in the specified range.
Spreadsheet object: Returns a Range object that represents all the rows on the active worksheet.
Worksheet object: Returns a Range object that represents all the rows on the specified worksheet.
expression.Rows
expression Required. An expression that returns one of the objects in the Applies To list.
Example
This example makes every other row bold in the current region for cell A1.
Sub BoldEvenRows()
Dim rngCurrentRow
' Loop through the rows in the current region.
For Each rngCurrentRow In Spreadsheet1.Cells(1, 1).CurrentRegion.Rows
' Check whenther the current row number is an even number.
If rngCurrentRow.Row Mod 2 = 0 Then
' Bold the font in the current row.
rngCurrentRow.Font.Bold = True
End If
Next
End Sub
This example makes row 2 bold.
Spreadsheet1.Rows(2).Font.Bold = True