PDA

View Full Version : Pivot Table events



peacenik
04-09-2007, 06:26 PM
I have some code that I want to run after changing a PivotFields().currentpage but I can't find an event to trigger it. Is it possible to create a Class Module for PivotTable events? Are there any other suggestions?

What I want to do is to display a calculation of the second last column of the pivot, divided by the last column of the pivot.

I am using Excel 2000.

geekgirlau
04-09-2007, 07:32 PM
Have you tried creating this as a calculated field?

peacenik
04-09-2007, 09:23 PM
Do you mean within the Pivot Table? If so, I need to know more than I do now about Pivot Tables. I want to divide the last column (only) by the Total. Can I do that in a calculated field?

peacenik
04-09-2007, 09:58 PM
I checked out Calculated fields and I don't think it will work, because I want to divide the total of a particular column (which is always the last column) by the grand total. From what I can see, Calculated fields doesn't do this.

geekgirlau
04-10-2007, 06:45 PM
Can you post a sample workbook?

XLGibbs
04-10-2007, 07:35 PM
Yes, you can show this without doing anything fancy.

Drag the column you want as the numerator into the pivot table data area.

Click the field settings options and choose advanced.

Choose to show the field as a % Of ___
and pick the option that suits your needs best (row,column or "previous" might work in your example)