Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I have 4 filters on 3 pivot tables, A, F, N. M. I need a button that when selected will automatically select one of the filters. I tried to do it by setting the autofilters on the three charts to Show All. I then recorded a macro for A, for example by select A from each pivot table. I did this for all four filters. and added the macros to buttons. The first one works, but when you hit any of the subsequent buttons, you get an error. In the data below, the last line for N in Chart 38 is in yellow when debugged. ActiveWindow.Visible = False Windows("Force Protection - Corporate.xls").Activate ActiveSheet.ChartObjects("Chart 38").Activate With ActiveChart.PivotLayout.PivotTable.PivotFields("Se rvice") .PivotItems("A").Visible = False .PivotItems("M").Visible = False .PivotItems("N").Visible = False End With ActiveWindow.Visible = False Windows("Force Protection - Corporate.xls").Activate ActiveSheet.ChartObjects("Chart 40").Activate With ActiveChart.PivotLayout.PivotTable.PivotFields("Se rvice") .PivotItems("A").Visible = False .PivotItems("M").Visible = False .PivotItems("N").Visible = False End With ActiveWindow.Visible = False Windows("Force Protection - Corporate.xls").Activate ActiveSheet.ChartObjects("Chart 48").Activate With ActiveChart.PivotLayout.PivotTable.PivotFields("Se rvice") .PivotItems("A").Visible = False .PivotItems("M").Visible = False .PivotItems("N").Visible = False End With End Sub Can someone tell me what is wrong and how I can fix it. Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Autofilter with pivot table | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
Change pivot table source data via macro | Excel Discussion (Misc queries) | |||
Macro to change a Pivot Table | Excel Discussion (Misc queries) |