Use the Resize Property to Change the Size of a Range

Contributor

The Resize property enables you to change the size of a range based on the location of the
active cell. You can create a new range as needed. The syntax for the Resize property is
Range.Resize(RowSize, ColumnSize)
To create a range B3:D13, use the following:
Range(“B3”).Resize(RowSize:=11, ColumnSize:=3)
Or a simpler way to create this range:
Range(“B3”).Resize(11, 3)
But what if you need to resize by only a row or a column, not both? You do not have to
enter both the row and column parameters.
If you need to expand by two columns, use one of the following:
or
Range(“B3”).Resize(ColumnSize:=2)
Range(“B3”).Resize(,2)
Both lines mean the same. The choice is yours. Resizing just the rows is similar. You can
use either of the following:
or
Range(“B3”).Resize(RowSize:=2)
Range(“B3”).Resize(2)
Once again, the choice is yours. It is a matter of readability of the code.

 

0 Replies