Applies To
Range Object.
Description
Resizes the range.
Syntax
object.Resize(rowSize, columnSize)
object
Required. The Range object to resize.
rowSize
Optional. The number of rows in the new range. If omitted, the range will keep the same number of rows.
columnSize
Optional. The number of columns in the new range. If omitted, the range will keep the same number of columns.
Example
This example resizes the selection on Sheet1 to extend it by one row and one column.
Worksheets("Sheet1").Activate numRows = Selection.Rows.Count numColumns = Selection.Columns.Count Selection.Resize(numRows + 1, numColumns + 1).Select
This example assumes that you have a table on Sheet1 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 you run the example.
Set tbl = ActiveCell.CurrentRegion tbl.Offset(1, 0).Resize(tbl.Rows.Count - 1, tbl.Columns.Count).Select