Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Resetting PivotFields
Hi yet again,
I am trying to run a macro that resets filters to single item selection with All as the default. Sub s_reset_chart() 'This Macro removes blank fields from the Pivot and resets the filters to Default Application.ScreenUpdating = False Application.StatusBar = "Resettimg Pivot Filters to Default." On Error GoTo 0 Set pt = Sheets(s_analysis).PivotTables("s_Data_Pivot") For Each vmycell In [s_graph_pages] ' Range that contains the Page Field names in the If vmycell.Value = "" Or vmycell.Value = 0 Then Exit For Set pf = pt.PivotFields(vmycell.Value) pf.AutoSort xlManual, vmycell.Value If vmycell.Value = [ay3].Value Then ' look for value and set default With pt.PivotFields(vmycell.Value) .CurrentPage = ("Input Raw Cost - Core") .EnableMultiplePageItems = False End With Else With pt.PivotFields(vmycell.Value) .CurrentPage = "(All)" .EnableMultiplePageItems = False End With End If pf.AutoSort xlAscending, vmycell.Value Next vmycell Application.StatusBar = "Filter Reset complete." Application.ScreenUpdating = True Application.StatusBar = False End Sub Maybe I should become a carpenter instead .. Any help appreciated. Best regards, Bony |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
PivotTable & PivotFields/VBA | Excel Programming | |||
PivotTable - PivotFields VBA | Excel Discussion (Misc queries) | |||
PivotFields problem | Excel Programming | |||
PivotFields | Excel Programming | |||
Pivotfields.CurrentPage | Excel Programming |