Offset Property in Excel VBA
The Offset property in Excel VBA takes the range which is a particular number of rows and columns away from a certain range.
Place a command button on your worksheet and add the following code lines:
1. The Offset property below returns a range which is 3 rows below and 2 columns to the right of a range.
Explanation: the Select method selects this range. The Offset property always takes the top left cell of a range as the starting point. Borders for illustration only.
2. The Offset property below returns a range which is 1 row above and 4 columns to the left of a range.
3. You can also offset by a number of rows only. For example, return a range which is 5 rows below a range.
4. Finally, you can also offset by a number of columns only. For example, return a cell which is 2 columns to the left of a cell.
For a practical example of the offset property, see our example program Create a Pattern.