Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default How to cycle through displayed PivotItems instead of theVisibleItems collection


I stumbled over a similar problem recently while trying to save
specific pivot table layouts. I solved it by using a case select and
making the pagefield temporarily a rowfield.
....
Dim pt as PivotTable
Dim objPF As PivotField
Dim pfItem As PivotItem

....
For Each objPF In pt.VisibleFields
Select Case objPF.Orientation
Case xlRowField
For Each pfItem In objPF.PivotItems
If pfItem.Visible = True Then
...
End If
Next pfItem
Case xlColumnField
For Each pfItem In objPF.PivotItems
If pfItem.Visible = True Then
...
End If
Next pfItem
Case xlPageField
objPF.Orientation = xlRowField
For Each pfItem In objPF.PivotItems
' Debug.Print pfItem.Parent.Name, pfItem.Name,
pfItem.Visible
If pfItem.Visible = True Then
....
End If
Next pfItem
objPF.Orientation = xlPageField
Case xlDataField

Case xlHidden

End Select
Next objPF
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
How do I make a graph with 2-cycle X 3-cycle log-log graph paper? Charles A. Wilson Charts and Charting in Excel 1 December 17th 09 03:03 AM
Missing PivotItems [email protected][_2_] Excel Programming 3 August 28th 08 10:09 PM
PivotItems Bug?! WhytheQ Excel Programming 2 November 29th 06 04:31 PM
How do I keep result from 1 iteration cycle to use in next cycle? sgl8akm Excel Discussion (Misc queries) 0 July 27th 06 08:28 PM
Add PivotItems to PivotTable / Enabling - Disabling PivotItems Ole[_3_] Excel Programming 1 July 8th 03 03:24 PM


All times are GMT +1. The time now is 07:26 AM.

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"