How to: Refer to Rows and Columns
Excel Developer Reference |
Use the Rows property or the Columns property to work with entire rows or columns. These properties return a Range object that represents a range of cells. In the following example, Rows(1)
returns row one on Sheet1. The Bold property of the Font object for the range is then set to True.
|
The following table illustrates some row and column references using the Rows and Columns properties.
Reference | Meaning |
---|---|
Rows(1) |
Row one |
Rows |
All the rows on the worksheet |
Columns(1) |
Column one |
Columns("A") |
Column one |
Columns |
All the columns on the worksheet |
To work with several rows or columns at the same time, create an object variable and use the Union method, combining multiple calls to the Rows or Columns property. The following example changes the format of rows one, three, and five on worksheet one in the active workbook to bold.
|
See Also