Hi All,
I have a financial table from which I created various pivot tables based on Fiscal Month. The table has columns labeled "Jan-10", "Feb-11" etc...
The Pivot Table has to show a rolling 3 months of actuals and 9 months of forecasted data. How do I make .Pivotfields dynamic so that it retrieves the correct data based on Fiscal month and year without hard coding as in the example below?
ActiveSheet.PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("Dec-10"), "Dec" & " " & Year(Date) - 1, xlCount
Thanks
I have a financial table from which I created various pivot tables based on Fiscal Month. The table has columns labeled "Jan-10", "Feb-11" etc...
The Pivot Table has to show a rolling 3 months of actuals and 9 months of forecasted data. How do I make .Pivotfields dynamic so that it retrieves the correct data based on Fiscal month and year without hard coding as in the example below?
ActiveSheet.PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("Dec-10"), "Dec" & " " & Year(Date) - 1, xlCount
Thanks