Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In a pivot table depending upon the selection of a pagefield value I
have to populate the value of a calculated field in row. Suppose Page field can have selections Income1 , Income2 and All then my calculated field will use different formula for three selections. I have tried some thing like this but its not working. I will really appreciate a quick response. Private Sub Worksheet_Calculate() 'Call CalculateIncomeSegment Debug.Print ActiveSheet.PivotTables("PivotTable1").PivotFields ("Income ").CurrentPage End Sub Private Sub CalculateIncomeSegment() If ActiveSheet.PivotTables("PivotTable1").PivotFields ("Income ").CurrentPage = "(All)" Then ActiveSheet.PivotTables("PivotTable1").CalculatedF ields( _ "Percent in Particular Segment").StandardFormula = "=inc_segA/ apps" ElseIf ActiveSheet.PivotTables("PivotTable1").PivotFields ("Income ").CurrentPage = "INCOME1" Then ActiveSheet.PivotTables("PivotTable1").CalculatedF ields( _ "Percent in Particular Segment").StandardFormula = "=inc_seg1/ apps" ElseIf ActiveSheet.PivotTables("PivotTable1").PivotFields ("Income ").CurrentPage = "INCOME2" Then ActiveSheet.PivotTables("PivotTable1").CalculatedF ields( _ "Percent in Particular Segment").StandardFormula = "=inc_seg2/ apps" End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calculated Field and Calculated Item in Pivot Table | Excel Discussion (Misc queries) | |||
pivot table formulas for calculated field or calculated item | Excel Discussion (Misc queries) | |||
Using a MIN, MAX formula on a calculated field in a pivot table | Excel Discussion (Misc queries) | |||
How to type correctly formula in calculated field in a pivot? | Excel Worksheet Functions | |||
How do I modify a row depending upon what a cell value is? | Excel Worksheet Functions |