PivotTable.ClearTable method (Excel)

The ClearTable method is used for clearing a PivotTable. Clearing PivotTables includes removing all the fields and deleting all filtering and sorting applied to the PivotTables. This method resets the PivotTable to the state it had right after it was created, before any fields were added to it.

Syntax

expression.ClearTable

expression A variable that represents a PivotTable object.

Remarks

The ClearTable function takes no arguments and is available for both relational and OLAP PivotTables.

Example

The following example clears a PivotTable on the active worksheet.

ActiveSheet.PivotTables(1).ClearTable()

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.