Hello,

I recorded a macro to change the current defined pivot table row label field to another row label field defined in the macro. See code below for changing row label field from month to year:

Please Login or Register  to view this content.
Because there is only 2 fields in the example above, I can create another macro that switch back from year to month.

Question: As I will have 3 or more row label fields, (ex: day, month, year), I cannot know for sure was is the current row label field (for example, if I am changing the field to year, what is the current field: day or month?) I would like to know the VBA code to report back the current row label field. The end VBA code could look something like this for changing the current row label field to Year:

Please Login or Register  to view this content.
I am using Excel 2010. Thank you for your time!