Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default 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
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
PivotTable & PivotFields/VBA Hutch Excel Programming 0 June 18th 08 09:22 PM
PivotTable - PivotFields VBA Hutch Excel Discussion (Misc queries) 0 June 18th 08 09:03 PM
PivotFields problem Tim Excel Programming 3 November 17th 05 05:33 PM
PivotFields Neal Excel Programming 2 September 20th 04 07:23 PM
Pivotfields.CurrentPage Daniel Magnus Bennét Björck Excel Programming 5 February 6th 04 02:48 PM


All times are GMT +1. The time now is 12:39 AM.

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"