Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can someone help me with this?
I need a Pivot table to change data according to information in a particular cell through VB. For example: if cell M3 is 3500 I want the Pivot table to show the information for 3500. My poor attempt below ActiveSheet.PivotTables("PivotTable2").PivotFields ("ID").CurrentPage = "RANGE (M3)" I can do it using IF's: If ActiveCell = 3500 Then ActiveSheet.PivotTables("PivotTable2").PivotFields ("ID").CurrentPage = "3500" End if But I would end up with an extremely long code, because there are up to 3500 combinations. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ActiveSheet.PivotTables("PivotTable2") _
.PivotFields("ID").CurrentPage = RANGE("M3").Text Should work if M3 is on the same pate as the pivot table. if not, you need to specify where it is ActiveSheet.PivotTables("PivotTable2") _ .PivotFields("ID").CurrentPage = _ worksheets("sheet3").RANGE("M3").Text -- Regards, Tom Ogilvy "JohnUK" wrote in message ... Can someone help me with this? I need a Pivot table to change data according to information in a particular cell through VB. For example: if cell M3 is 3500 I want the Pivot table to show the information for 3500. My poor attempt below ActiveSheet.PivotTables("PivotTable2").PivotFields ("ID").CurrentPage = "RANGE (M3)" I can do it using IF's: If ActiveCell = 3500 Then ActiveSheet.PivotTables("PivotTable2").PivotFields ("ID").CurrentPage = "3500" End if But I would end up with an extremely long code, because there are up to 3500 combinations. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to create pivot table from existing pivot table in excel 2007 | Excel Discussion (Misc queries) | |||
Filter lines with Pivot table and non Pivot table columns | Excel Discussion (Misc queries) | |||
Filter lines containing pivot table and non pivot table data | Excel Worksheet Functions | |||
How do I create a pivot table if the pivot table icon or menu ite. | Charts and Charting in Excel | |||
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" | Excel Programming |