How to determine order of row fields in pivot table

J

Joerg Mochikun

I need to determine the order of row fields in any given pivot table.
Problem: I don't know how.

For an example please refer to http://www.cpearson.com/excel/pivots.htm on
C.Pearson's site.

Database fields: Who Week What Amount. The example pivot table has 3 row
fields:Who Week What.

I can address the row fields:

ActiveSheet.PivotTables(1).RowFields(1).name => Who

ActiveSheet.PivotTables(1).RowFields(2).name => Week

ActiveSheet.PivotTables(1).RowFields(3).name => What

I found that the indexes of RowFields are NOT determined by the order in
which the row fields appear in the pivot table, but rather by the order of
their appearance in the database. So when I switch the row fields in the
pivot table to What Week Who, the leftmost row field in the resulting pivot
table (What) must still be referred to as RowFields(3), not RowFields(1).

As a user can freely rearrange row fields of a pivot table, is there any
method to determine the actual order of these fields?

Thanks for any suggestion

Joerg Mochikun
 

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