ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Clearing Pivot table (https://www.excelbanter.com/excel-programming/356133-clearing-pivot-table.html)

Wike05

Clearing Pivot table
 
Im using pivot tables to make reports for my boss in excel. But she has no
idea how to use them so i created macros that set the reports up for her.
The problem is i need the macro to clear the current layout in the pivot
table before it applies the new layout.

Debra Dalgleish

Clearing Pivot table
 
As answered in microsoft.public.excel.misc --

You can hide all the fields:


Sub ClearPivot()
Dim pt As PivotTable
Dim pf As PivotField
Set pt = ActiveSheet.PivotTables(1)

For Each pf In pt.PivotFields
pf.Orientation = xlHidden
Next pf

End Sub


Wike05 wrote:
Im using pivot tables to make reports for my boss in excel. But she has no
idea how to use them so i created macros that set the reports up for her.
The problem is i need the macro to clear the current layout in the pivot
table before it applies the new layout.



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



All times are GMT +1. The time now is 11:12 PM.

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