Name

range.Offset([RowOffset], [ColumnOffset])

Synopsis

Returns a Range object representing a range of cells offset from the specified range by a specified number of rows or columns.

Argument

Settings

RowOffset

The number of rows by which the range should be offset. A negative value offsets the rows upward.

ColumnOffset

The number of columns by which the range should be offset.

The following code activates a range one row down and one column to the right of the specified range:

Dim r As Range
 
Set r = ActiveSheet.Range("A1:B5")
r.Offset(1, 1).Activate

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.