title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
ListObject.Resize method (Excel) |
vbaxl10.chm734079 |
|
|
b9a0ae05-d1cd-3ce6-f4ae-6a539850a1b5 |
06/08/2019 |
medium |
The Resize method allows a ListObject object to be resized over a new range. No cells are inserted or moved.
expression.Resize (Range)
expression An expression that returns a ListObject object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
Range | Required | Range | The new range. |
For tables that are linked to a server that is running Microsoft SharePoint Foundation, you can resize the list using this method by providing a Range argument that differs from the current range of the ListObject only in the number of rows it contains. Attempting to resize lists linked to SharePoint Foundation by adding or deleting columns (in the Range argument) results in a run-time error.
The following example uses the Resize method to resize the default ListObject object on Sheet1 of the active workbook.
Sub ResizeList()
Dim wrksht As Worksheet
Dim objListObj As ListObject
Set wrksht = ActiveWorkbook.Worksheets("Sheet1")
Set objListObj = wrksht.ListObjects(1)
objListObj.Resize Range("A1:B10")
End Sub
[!includeSupport and feedback]