Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear All,
I've got the following code which nearly works! '================================== Sub Change_Pivot_Months() Dim Worksheet Dim Pivot Dim PivotItem Dim myLatestMonth For Each Worksheet In Worksheets For Each Pivot In Worksheet.PivotTables For Each PivotItem In Pivot.PivotFields("Month").PivotItems Select Case PivotItem Case Format(Range("Month1"), "mmm-yy") PivotItem.Visible = True Case Format(Range("Month2"), "mmm-yy") PivotItem.Visible = True Case Format(Range("Month3"), "mmm-yy") PivotItem.Visible = True Case Else PivotItem.Visible = False End Select Next PivotItem Next Next Worksheet End Sub '==================================== The aim of the above was to have it so that each pivottable in the workbook will only show the months in the 3 cells spoecified in the worksheet (Range("Month1")...) and to make all other months visible=False. The above seems to fall down when it hits "PivotItem.Visible = True" Can anyone help?...it would be well appreciated. Regards, Jason. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing/Manipulating Legend range for a Pivot Chart in XL2010 vsXL2003 and below. | Charts and Charting in Excel | |||
Manipulating pivot table fields ... | Excel Discussion (Misc queries) | |||
Manipulating Pivot Table Data Fields | Charts and Charting in Excel | |||
Manipulating Pivot Tables With Macros | Excel Programming | |||
Manipulating Pivot Tables with VBA | Excel Programming |