Range.Offset Property
Excel Developer Reference |
Returns a Range object that represents a range that’s offset from the specified range.
Syntax
expression.Offset(RowOffset, ColumnOffset)
expression A variable that represents a Range object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
RowOffset | Optional | Variant | The number of rows (positive, negative, or 0 (zero)) by which the range is to be offset. Positive values are offset downward, and negative values are offset upward. The default value is 0. |
ColumnOffset | Optional | Variant | The number of columns (positive, negative, or 0 (zero)) by which the range is to be offset. Positive values are offset to the right, and negative values are offset to the left. The default value is 0. |
Example
This example activates the cell three columns to the right of and three rows down from the active cell on Sheet1.
Visual Basic for Applications |
---|
|
This example assumes that Sheet1 contains a table that has a header row. The example selects the table, without selecting the header row. The active cell must be somewhere in the table before the example is run.
Visual Basic for Applications |
---|
|
See Also