Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Pivot Items Visible

I'm trying to make all pivot items non visible and then mak only one visible
based on a cell value.


Dim pitem As PivotItem



Sheet3.PivotTables("TypesOfService").ManualUpdate = True

''''''Show all items
For Each pitem In
Sheet3.PivotTables("TypesOfService").PivotFields(" Type of service").PivotItems
pitem.Visible = False
Sheet3.PivotTables("TypesOfService").PivotFields(" Type of
service").PivotItems("(blank)").Visible = False
Next


Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 376
Default Pivot Items Visible

Hi Luis

Here is part of some code I use, to only show pivot items that lie
between two dates. In my case, the Date field is a page Item

I set them all to Visible first, then hide the invalid ones, but it
would work equally well the other way around.

Sub FilterPivotDatesFeed()

Dim dStart As Date, dEnd As Date, wks As Long
Dim pt As PivotTable, pf As PivotField, pi As PivotItem

On Error Resume Next

Set pt = ActiveSheet.PivotTables(1)
Set pf = pt.PivotFields("Date")

pt.ManualUpdate = True

pf.EnableMultiplePageItems = True

For Each pi In pf.PivotItems
pi.Visible = True
Next pi

For Each pi In pf.PivotItems
If pi.Value < dStart Or pi.Value dEnd Then
pi.Visible = False
End If
Next pi

pt.ManualUpdate = False

Hope this helps you.

--
Regards
Roger Govier

LuisE wrote:
I'm trying to make all pivot items non visible and then mak only one visible
based on a cell value.


Dim pitem As PivotItem



Sheet3.PivotTables("TypesOfService").ManualUpdate = True

''''''Show all items
For Each pitem In
Sheet3.PivotTables("TypesOfService").PivotFields(" Type of service").PivotItems
pitem.Visible = False
Sheet3.PivotTables("TypesOfService").PivotFields(" Type of
service").PivotItems("(blank)").Visible = False
Next


Thanks in advance

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
Hide all items in Pivot Field except specific items VAMS Excel Programming 1 June 19th 09 10:19 AM
Set Pivot-Table Visible Items Mike H. Excel Programming 1 July 25th 08 08:59 PM
Unable to access visible property of Pivot Items class Geoff Excel Programming 2 May 21st 07 03:00 AM
Unable to access visible property of Pivot Items class Geoff Excel Programming 0 May 20th 07 10:20 PM
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 05:07 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"