About calling highest level in columnfield
Hi!
I have a problem in writing VBA related to Pivot Table. I
hope somebody can help me.
My data in Pivot Table is from OLAP cube. I want to do
filtering according to the highest level of column fields.
For example, if my column fields are arranged as District
first and then Year(i.e. Region A/2002, Region A/2003,
Region A/2004, Region B/2002, Region B/2003, ......), I
can choose one of the district as a filter item. If my
column fields are arranged as Year first and then
District (i.e. 2002/Region A, 2002/Region B, 2003/Region
A, 2003/Region B, ......), I can only choose one of the
year as a filter item.
I try to use "columnfields(x)" to call them.
However, "columnfields(1)" doesn't mean the highest level
of column fields. It seems that "columnfields(1)" is
assigned to field which is firstly dragged to column
field in pivot table.
Hope somebody can help me. Thanks
Best Wishes,
Polly
|