ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PivotTable - Clear all data fields (https://www.excelbanter.com/excel-programming/407806-pivottable-clear-all-data-fields.html)

Bradley Searle[_2_]

PivotTable - Clear all data fields
 
Hi,

I've created a PivotTable which uses control buttons to tigger a macro that
selects which Report Filters, Row Labels and Values to select for a
particular 'view'. There are three of these buttons / macros and this works
ok.

When someone selects another 'view' by pressing a different button, I have
to use the following code to clear the Pivot (otherwise the Pivot will
display the existing fields as well as the new ones):

ActiveSheet.PivotTables("Central").ClearTable

This is fine - except by using ClearTable I lose any field formats (eg. £ in
the Value fields) and the Pivot automatically applies Subtotals to every
field again.

IS there any way of clearing all the currently selected fields without using
the ClearTable function (so that my formatting remains)?

Really appreciate any help. Thanks


All times are GMT +1. The time now is 02:31 AM.

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