Resize Method

Microsoft Excel Visual Basic

Resize Method

The Resize method allows a ListObject object to be resized over a new range. No cells are inserted or moved. Returns Nothing.

expression.Resize(Range)

expression    Required. An expression that returns a ListObject object.

Range   Required Range.

Remarks

For lists that are linked to a server that is running Microsoft Windows SharePoint Services, 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 Windows SharePoint Services 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 in 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