The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This documentation is archived and is not being maintained.
How to: Refer to Cells by Using Index Numbers
Excel Developer Reference
You can use the Cells
property to refer to a single cell by using row and column index numbers. This property returns a Range object that represents a single cell. In the following example, Cells(6,1) returns cell A6 on Sheet1. The Value property is then set to 10.
Worksheets("Sheet1").Cells(6, 1).Value = 10
The Cells property works well for looping through a range of cells, because you can substitute variables for the index numbers, as shown in the following example.
Dim Counter As Integer
For Counter = 1 To 20
Worksheets("Sheet1").Cells(Counter, 3).Value = Counter