Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Macros to change Pivot Field

Hi,

I have a 6 pivot tables with different views on a single sheet linked
to the same source.

At the top of the page/Sheet, I have given the user the 2 options
using a drop down.

1st Option - Select Month - Jan, Feb, Mar etc....
2nd Option - Select View - Month to date / Year to date

The input provided by the user is "Named" as "Select_Month" and
"Select_View"

I would like to know I can pass the value provided by the year for the
month and Pivotitems matching that month becomes True. Also I would
like to select the same month of the previous year. for eg if
February, 2007 is selected, February, 2006 should also be selected.

The case becomes more complex when the month and YTD option is
selected. For eg if December, 2006 is selected and YTD. The Months
from Jul to Dec, 2006 and 2005 needs to be made True.

Any help on this is appreciated.

With ActiveSheet.PivotTables("Overview1").PivotFields(" Fiscal Month")
.PivotItems("July, 2005").Visible = False
.PivotItems("August, 2005").Visible = False
.PivotItems("September, 2005").Visible = False
.PivotItems("October, 2005").Visible = False
.PivotItems("November, 2005").Visible = False
.PivotItems("December, 2005").Visible = False
.PivotItems("January, 2006").Visible = False
.PivotItems("February, 2006").Visible = False
.PivotItems("March, 2006").Visible = False
.PivotItems("April, 2006").Visible = False
.PivotItems("May, 2006").Visible = False
.PivotItems("June, 2006").Visible = False
.PivotItems("July, 2006").Visible = True
.PivotItems("August, 2006").Visible = False
.PivotItems("September, 2006").Visible = False
.PivotItems("October, 2006").Visible = False
.PivotItems("November, 2006").Visible = False
.PivotItems("December, 2006").Visible = False
.PivotItems("January, 2007").Visible = False
.PivotItems("February, 2007").Visible = False
.PivotItems("March, 2007").Visible = False
.PivotItems("April, 2007").Visible = False
.PivotItems("May, 2007").Visible = False
.PivotItems("June, 2007").Visible = False
End With

Regards
Sandip.

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
Change the name of the Data field in a Pivot Table John Excel Discussion (Misc queries) 2 October 6th 08 05:16 PM
Change Field On Pivot Table Using VBA Input Box Cue Excel Discussion (Misc queries) 0 July 4th 08 06:51 PM
Unable to change field settings in calculated field in a pivot tab Mike Excel Discussion (Misc queries) 0 September 25th 06 07:45 PM
change 'count of' to 'sum of' in pivot table field Rob B Excel Discussion (Misc queries) 2 July 28th 06 10:03 AM
Change Pivot Field Value Des[_2_] Excel Programming 4 May 17th 06 09:53 AM


All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"