Version

Resize(WorksheetRegion) Method

Resizes the table to a new range of data on the worksheet.
Syntax
'Declaration
 
Public Overloads Sub Resize( _
   ByVal headerAndDataRegion As WorksheetRegion _
) 
public void Resize( 
   WorksheetRegion headerAndDataRegion
)

Parameters

headerAndDataRegion
The new region of headers (if currently visible) and data for the table, which must contain at least one data row, and overlap and have the same top as the current table region.
Exceptions
ExceptionDescription
System.InvalidOperationExceptionOccurs when the WorksheetTable has previously been removed from the worksheet.
System.ArgumentNullExceptionOccurs when headerAndDataRegion is null.
System.ArgumentExceptionOccurs when headerAndDataRegion from a different worksheet or has been previously shifted off the table's worksheet.
System.ArgumentExceptionOccurs when the top of the headerAndDataRegion does is not the same as the top of the table.
System.ArgumentExceptionOccurs when the headerAndDataRegion does not contain at least one data row for the table.
System.ArgumentExceptionOccurs when the headerAndDataRegion does not overlap the current table region.
System.InvalidOperationException Occurs when the there is a merged cell, array formula, data table, or another table in the new region.
Remarks

If the totals row is visible, it will be placed below the last data row automatically. If the totals row is currently inside the new table region, it will be moved out to below the new data rows, which will be shifted up by one row.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also