ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete pivot table (https://www.excelbanter.com/excel-programming/299380-delete-pivot-table.html)

Zic[_2_]

Delete pivot table
 
Hi all
XL2003
I have been looking for a "sensible" way to delete a pivot table in my
workbook but to no avail.
Currently here is below what I use, can someone supply a better method?
ThisWorkbook.Sheets("Data").Activate
ActiveSheet.PivotTables(1).PivotSelect "", _
xlDataAndLabel, True
Selection.Clear

TIA

Zic



Debra Dalgleish

Delete pivot table
 
You can use the TableRange2 property:

ActiveSheet.PivotTables(1).TableRange2.Clear

Zic wrote:
Hi all
XL2003
I have been looking for a "sensible" way to delete a pivot table in my
workbook but to no avail.
Currently here is below what I use, can someone supply a better method?
ThisWorkbook.Sheets("Data").Activate
ActiveSheet.PivotTables(1).PivotSelect "", _
xlDataAndLabel, True
Selection.Clear


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


Zic[_2_]

Delete pivot table
 
Thank you Debra this works a treat!
Zic
"Debra Dalgleish" a écrit dans le message de
...
You can use the TableRange2 property:

ActiveSheet.PivotTables(1).TableRange2.Clear

Zic wrote:
Hi all
XL2003
I have been looking for a "sensible" way to delete a pivot table in my
workbook but to no avail.
Currently here is below what I use, can someone supply a better method?
ThisWorkbook.Sheets("Data").Activate
ActiveSheet.PivotTables(1).PivotSelect "", _
xlDataAndLabel, True
Selection.Clear


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





All times are GMT +1. The time now is 02:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com