ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Pivot Table Help (https://www.excelbanter.com/excel-discussion-misc-queries/77712-pivot-table-help.html)

Wike05

Pivot Table Help
 
Im using pivot tables to make reports for my boss in excel. But she has no
idea how to use them so i recorded macros that set the different 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.


robert111

Pivot Table Help
 

Can you write a separate macro to do the clearing, and attach it to a
prominent button object that she can click before resetting.

Alternatively, put each pivot on a separate sheet and then all she
needs to do is open the required sheet.


--
robert111
------------------------------------------------------------------------
robert111's Profile: http://www.excelforum.com/member.php...o&userid=31996
View this thread: http://www.excelforum.com/showthread...hreadid=523058


Wike05

Pivot Table Help
 
i only know how to record and do some minor editing of macros. but i cant
figure what i need to stick in the begining of the macro to have clear the
layout, then apply the new layout.

"robert111" wrote:


Can you write a separate macro to do the clearing, and attach it to a
prominent button object that she can click before resetting.

Alternatively, put each pivot on a separate sheet and then all she
needs to do is open the required sheet.


--
robert111
------------------------------------------------------------------------
robert111's Profile: http://www.excelforum.com/member.php...o&userid=31996
View this thread: http://www.excelforum.com/showthread...hreadid=523058



Debra Dalgleish

Pivot Table Help
 
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 recorded macros that set the different 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 05:50 PM.

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