Range.Item Property
Excel Developer Reference |
Returns a Range object that represents a range at an offset to the specified range.
Syntax
expression.Item(RowIndex, ColumnIndex)
expression A variable that represents a Range object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
RowIndex | Required | Variant | The index number of the cell you want to access, in order from left to right, then down.
|
|
|||
|
|||
ColumnIndex | Optional | Variant | A number or string that indicates the column number of the cell you want to access, starting with either 1 or "A" for the first column in the range. |
Remarks
Syntax 1 uses a row number and a column number or letter as index arguments. For more information about this syntax, see the Range object. The RowIndex and ColumnIndex arguments are relative offsets. In other words, specifying a RowIndex of 1 returns cells in the first row of the range, not the first row of the worksheet. For example, if the selection is cell C3, Selection.Cells(2, 2)
returns cell D4 (you can use the Item property to index outside the original range).
Example
This example fills the range A1:A10 on Sheet1, based on the contents of cell A1.
Visual Basic for Applications |
---|
|
See Also