Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
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
Controlling Pivotitems.visible sxhwabbiemike Excel Discussion (Misc queries) 0 January 21st 09 03:09 AM
Error 1004 with PivotItems.Visible Charlie Rowe Excel Programming 2 November 18th 05 04:16 PM
Visible PivotItems matching criteria westg Excel Programming 1 August 31st 05 05:34 PM
Always keep the same 4 PivotItems visible Martin[_21_] Excel Programming 2 April 27th 05 10:17 AM
PivotItems.Count is 0 when items are visible on the sheet iD Excel Programming 4 March 3rd 05 02:07 AM


All times are GMT +1. The time now is 08:16 PM.

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"