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:

ActiveSheet.PivotTables("PivotTable1").PivotFields("Month").Orientation = _
        xlHidden
    With ActiveSheet.PivotTables("PivotTable1").PivotFields("Year")
        .Orientation = xlRowField
        .Position = 1
    End With
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:

CurrentRowField= ????

ActiveSheet.PivotTables("PivotTable1").PivotFields(CurrentRowField).Orientation = _
        xlHidden
    With ActiveSheet.PivotTables("PivotTable1").PivotFields("Year")
        .Orientation = xlRowField
        .Position = 1
    End With
I am using Excel 2010. Thank you for your time!