Rows Property

Microsoft Office Web Components Object Model

Rows Property

       

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