PC Review


Reply
Thread Tools Rate Thread

How to determine order of row fields in pivot table

 
 
Joerg Mochikun
Guest
Posts: n/a
 
      27th Aug 2007
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


 
Reply With Quote
 
 
 
 
Joerg Mochikun
Guest
Posts: n/a
 
      27th Aug 2007
Found it myself: 'Position property ' is the answer
Joerg

"Joerg Mochikun" <(E-Mail Removed)> wrote in message
news:fatg31$2e1$(E-Mail Removed)...
>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
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table and Pivot Table dates are not in correct order ls Microsoft Excel Charting 3 14th Jul 2009 04:02 PM
Re: Specifying the order of pivot table calculated fields/items Herbert Seidenberg Microsoft Excel Misc 0 10th Aug 2008 01:56 AM
determine the name of the selected pivot table Tim879 Microsoft Excel Misc 1 23rd Sep 2007 05:02 PM
determine if value in pivot table =?Utf-8?B?Z2VlYmVl?= Microsoft Excel Programming 0 18th Sep 2007 07:48 PM
Re: How do I best determine table update order? NorCan Microsoft ADO .NET 1 26th Nov 2005 11:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:55 PM.