Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Pivot Table help!

Is there a specific news net that deals with pivot tables? Or any web sites?
My problem is I have a calculated field that will divide a field number by a
monthly constant. My page field is the Month column so I can select any of
the months to display in the pivot table. However, the constant in the
calculated field is different for each month. Right now I have 12 copies of
the same pivot table, each displaying a different Month, then I edit the
constant for each table. So I really have a variable constant for each
month. Is there a way to tell the calculated field to use a certain constant
depending upon which month is selected in the page field? That would let me
get rid of the other 11 table copies.

Mike F


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Pivot Table help!

You could use a worksheet formula to return the value for the month
selected in the page field, e.g.:

=VLOOKUP(B3,MonthLU,2,0)

Then, use the PivotUpdate event to change the calculated field, e.g.:

'==========================
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Dim lMonth As Long
lMonth = Me.Range("MonthValue").Value

Application.EnableEvents = False
Me.PivotTables(Target.Name).CalculatedFields("Mont hDiv") _
.StandardFormula = "=Units/" & lMonth
Application.EnableEvents = True

End Sub
'============================

Mike Fogleman wrote:
Is there a specific news net that deals with pivot tables? Or any web sites?
My problem is I have a calculated field that will divide a field number by a
monthly constant. My page field is the Month column so I can select any of
the months to display in the pivot table. However, the constant in the
calculated field is different for each month. Right now I have 12 copies of
the same pivot table, each displaying a different Month, then I edit the
constant for each table. So I really have a variable constant for each
month. Is there a way to tell the calculated field to use a certain constant
depending upon which month is selected in the page field? That would let me
get rid of the other 11 table copies.

Mike F




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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to create pivot table from existing pivot table in excel 2007 Udayraj Dhulekar Excel Discussion (Misc queries) 2 July 8th 13 08:22 PM
Print Pivot Table headers on pages with Pivot Table tsgoose Excel Worksheet Functions 0 December 9th 08 08:14 PM
Filter lines containing pivot table and non pivot table data Grover Excel Worksheet Functions 0 September 24th 07 07:20 PM
How do I create a pivot table if the pivot table icon or menu ite. Lynn@WS Charts and Charting in Excel 1 December 16th 04 02:36 AM
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" Diana[_5_] Excel Programming 0 August 21st 03 10:19 PM


All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"