ExcelBanter

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

SaeOngJeeMa

Delete a Pivot Table
 
I have a Worksheet with a bunch of Controls (combo boxes, text boxes, etc)
and a Pivot Table. I need to be able to programmatically delete or remove the
Pivot Table without deleting the Worksheet (because I need to keep the
Controls intact). Does anyone know how to do that? BTW, even if it can't be
done programmatically, is there a way to do it manually? Thanks in advance.
Best Regards,
Dean

Jim Cone

Delete a Pivot Table
 

Dean,
The help file is not much help on this one.
(I think the summer intern must have come up with this one)<g

ActiveSheet.PivotTables("name").TableRange2.Clear
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"SaeOngJeeMa"

wrote in message
I have a Worksheet with a bunch of Controls (combo boxes, text boxes, etc)
and a Pivot Table. I need to be able to programmatically delete or remove the
Pivot Table without deleting the Worksheet (because I need to keep the
Controls intact). Does anyone know how to do that? BTW, even if it can't be
done programmatically, is there a way to do it manually? Thanks in advance.
Best Regards,
Dean

Debra Dalgleish

Delete a Pivot Table
 
To delete the first pivot table on the active sheet:

ActiveSheet.PivotTables(1).TableRange2.Clear


SaeOngJeeMa wrote:
I have a Worksheet with a bunch of Controls (combo boxes, text boxes, etc)
and a Pivot Table. I need to be able to programmatically delete or remove the
Pivot Table without deleting the Worksheet (because I need to keep the
Controls intact). Does anyone know how to do that? BTW, even if it can't be
done programmatically, is there a way to do it manually? Thanks in advance.
Best Regards,
Dean



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html


SaeOngJeeMa

Delete a Pivot Table
 
Thanks Jim and Debra. Works great!
--
Best Regards,
Dean


"Debra Dalgleish" wrote:

To delete the first pivot table on the active sheet:

ActiveSheet.PivotTables(1).TableRange2.Clear


SaeOngJeeMa wrote:
I have a Worksheet with a bunch of Controls (combo boxes, text boxes, etc)
and a Pivot Table. I need to be able to programmatically delete or remove the
Pivot Table without deleting the Worksheet (because I need to keep the
Controls intact). Does anyone know how to do that? BTW, even if it can't be
done programmatically, is there a way to do it manually? Thanks in advance.
Best Regards,
Dean



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html




All times are GMT +1. The time now is 06:55 AM.

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