Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default working with pivot tables items

Hello all,

I am hoping someone can help. I am trying to programmatically work
with data in pivot tables but am having some difficulty looping
through items in the table in an efficient way. Here's a simplified
version of what I am trying to do:

Consider a Pivot table that contains two row items (Group and
SubGroup) and one data item (Data):

Group1 SubGroup1 Data1
Group1 SubGroup2 Data2
Group1 SubGroup3 Data3

Group2 SubGroup4 Data4
Group2 SubGroup5 Data5
Group2 SubGroup6 Data6

I would like to find an efficient way to loop through each of the
Groups, and within each of the Groups through the SubGroups. The goal
is to get each Group, SubGroup and Data combination and copy the
values for each to another range depending on the Group.

I have tried the following so far:

Reference ChildItems: unfortunately this does not work like I hoped.
For example, I was hoping that SubGroups1, 2 and 3 would be ChildItems
of Group1, but they apparently are not (I tried looping through all of
the PivotItems to count ChildItems but none have any).

Next, I thought I could just loop through the Group items, and set
visibility for all but one at a time to False. Then, I could loop
through all visible SubGroup items and return the corresponding Data
items. However, if I set Group2's visibility to False, although the
pivot table no longer shows the values for SubGroups 4, 5 and 6, their
visibility is unfortunately technically not False.

I hope I've been clear. If anyone has any suggestions I would greatly
appreciate hearing them. Thanks in advance.

Best,

TP

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
Updating pivot items on 3 pivot tables contained on one sheet klysell Excel Programming 2 August 9th 07 07:00 PM
Updating pivot items in three pivot tables on one sheet via VBA klysell Excel Programming 0 August 8th 07 07:20 PM
Name items in Pivot Tables? Sheila D Excel Discussion (Misc queries) 4 December 1st 06 01:54 PM
Cycle through Pivot Tables with Pivot Items [email protected] Excel Programming 0 October 15th 06 10:31 PM
ticked items on Pivot tables Matt123 Excel Discussion (Misc queries) 1 October 11th 06 10:13 PM


All times are GMT +1. The time now is 12:08 AM.

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"