In this post, you’ll learn how to resize column and rows in your Excel spreadsheet using Excel VBA.
Resize Property
The Resize Property of the Range Object will return a new range resized from the original Range object.
Syntax
The syntax for the Resize property
Range("A1").Resize (RowSize, ColumnSize)
Note: RowSize and ColumnSize must be greater than zero.
Resize Number of Rows and Columns
To resize column and row in Excel VBA
Code:
Range("A1:D5").Resize(5, 5).Select
Resize Number Of Rows Only
To resize number of Rows alone,
Code:
Range("A1").Resize(10).Select
Resize Number Of Columns Only
To resize the number of Columns alone
Code:
Range("A1").Resize(, 5).Select