Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trouble setting visible property for PivotItems
Hey,
I'm trying to set the visibility of the PIvotItems in a for a particular PivotField. I keep getting the following error: "Run Time Error: 1004. Unable to set the visible property of the PivotItem class." Here's my code (just the loop I'm having trouble with): 'Select only the current week to display PF.AutoSort xlManual, "Week Ending" For Each PI In PF.PivotItems If PI.Name <= DateAdd("ww", -1, Date) Then PI.Visible = False End If Next PI 'End Select only the current week to display Basically, I have pivot table with data for each week of the current year and my goal is to display the most recent week which in this case would be the current date minus 1 week. Any help would be greatly appreciated! -- -ridawg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Controlling Pivotitems.visible | Excel Discussion (Misc queries) | |||
Error 1004 with PivotItems.Visible | Excel Programming | |||
Visible PivotItems matching criteria | Excel Programming | |||
Always keep the same 4 PivotItems visible | Excel Programming | |||
PivotItems.Count is 0 when items are visible on the sheet | Excel Programming |