ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   About calling highest level in columnfield (https://www.excelbanter.com/excel-programming/299135-about-calling-highest-level-columnfield.html)

Polly[_3_]

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


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com