LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Controlling Pivotitems.visible

I have a PivotTable and would like to selectively display PivotItems.

I'm running the following code which will only display the "install dates"
for the next 7 days starting with the current date although I do want all of
the dates available for display.

The code works, but is very slow since the there are hundreds of unique
PivotItems.

Is there a ways to set all of the PivotItems visibility to FALSE and then
only set the ones I want displayed to TRUE.

Looking for a faster more efficient technique.

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Install Date")
y = .PivotItems.Count - 1
For x = 1 To y
.PivotItems(x).Visible = False
Next
.PivotItems("1/20/2009").Visible = True
.PivotItems("1/21/2009").Visible = True
.PivotItems("1/22/2009").Visible = True
.PivotItems("1/23/2009").Visible = True
.PivotItems("1/24/2009").Visible = True
.PivotItems("1/25/2009").Visible = True
.PivotItems("1/26/2009").Visible = True
.PivotItems(y + 1).Visible = False
End With

 
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
PIvotitems visible greenthumb Excel Programming 0 September 19th 07 02:14 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


All times are GMT +1. The time now is 02:07 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"