Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Re-run subroutine when pivot page field is changed
Hello,
I currently have a subroutine that basically executes contiional formats on a pivot table. I was wondering if there is a way that if a user changes the page field that I can remove all of the formats and then re-run the routine for the newly displayed data. Thanks in advance for your assistance. John |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Re-run subroutine when pivot page field is changed
Hi Aerotjk
You can do this. In the module for the worksheet that contains the pivot table, select Worksheet in the Object drop down, and you should see PivotTableUpdate in the Procedure drop down. Selecting these will give you a Sub like this (or you can simply write the code below, in the Worksheet module): Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable) End Sub You can then write, or call, your routine in here. If there are multiple Pivot Tables on that sheet then use the Target variable to make sure you have the right one. Hope this helps, Sean. "AEROTJK" wrote: Hello, I currently have a subroutine that basically executes contiional formats on a pivot table. I was wondering if there is a way that if a user changes the page field that I can remove all of the formats and then re-run the routine for the newly displayed data. Thanks in advance for your assistance. John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can Multiple Range Pivot Table's field button's caption be changed | Excel Discussion (Misc queries) | |||
Pivot Table Page Field | Excel Programming | |||
run macro every time page field change is changed | Excel Programming | |||
second axis disappears on pivot chart when page field changed | Charts and Charting in Excel | |||
Returning actual page field changed in pivottable | Excel Programming |