Open In App

How to Delete a Pivot Table in Excel?

A pivot table is a tool in Excel that allows you to quickly summarize data in the spreadsheet. When it comes to deleting a Pivot Table, there are a few different ways you can do this.

The method you choose will depend on how you want to delete the Pivot Table.



1.Delete the Pivot Table and the Resulting Data.

Steps to delete the Pivot table and the Resulting Data-



2.Delete the Pivot Table but Keep the Resulting Data.

If we want to delete the entire pivot table but retain the resulting data, the procedure is more or less the same

Steps to delete the Pivot table but Keep the Resulting Data:

The above steps would delete the Pivot Table but still keep the resulting data.

3.Delete the Resulting Data but Keep the Pivot Table.

Below are the steps to keep the Pivot table and remove the resulting data only:

4.Delete All Pivot Tables in One Go.

We have learned the easy way of removing or deleting the pivot table in Excel. But deleting many pivot tables in a workbook is not that easy. So we need VBA code to delete pivot tables in one go

Below is VBA code:

Sub DeleteAllPivotTables()
Dim Ws As Worksheet, Pt As PivotTable
On Error Resume Next
For Each Ws In ActiveWorkbook.Worksheets
    For Each Pt In Ws.PivotTables
        Ws.Range(Pt.TableRange2.Address).Delete Shift:=xlUp
    Next Pt
Next Ws
End Sub

This code needs to be placed in the regular module in the VB Editor

Below are the steps to put this code in the module:

Things to Remember

Article Tags :