List of Displayed Pivot Items

M

mark

Hi.

I'm looking for a way to quickly get a list of the displayed pivot items in
a pivot field.

For instance, I have two row fields in the pivot table. The first row field
has several pivot items, and I've selected the <blank> pivot item in row
field 1.

I want to know what items that leaves displayed in row field 2.

In my case, it's a list of 4 items.

I tried the .visibleitems collection of row field 2, but that gives all of
the items that are checked, not the small subset that had a row field 1 =
<blank>

I think I could do it by starting at the top of the cells where row field 2
is displayed, and walking down through the cells of the pivot table, but that
seems clunky.

Suggestions?

Thanks.
 
M

mark

I worked it up using the address of the pivot tables row range, the position
of the field I'm interested in, and the number of rows in the row range.

Then had it walk down the proper column, putting the values into a string
array.

It works.

Had hoped there was a more automatic way, but this isn't long.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top