I have around 6 Columns in PivotTable namely 0-30 days, 31-60 days, 61-90 days, 91- 120 days, 121-150 days, 151-180 days
Thing is I want to have 0-30 in 1st position, 31-60 days in 2nd position and so.
Simple thing which I write is
ActiveSheet.PivotTables("PivotTable12").PivotFields("0-30 days").position = 1,
ActiveSheet.PivotTables("PivotTable12").PivotFields("31-60 days").position = 2 and so in chronological order
But the issue is there are times when 31-60 days / 61-90 days /or any one or more of the above column field may not be present at all.
i..e, there might be only two fields in those scenario say , 61-90 days and 91-120 days (then 61-90 days should be first and 91-120 days should be second).
In the above scenario, my position (due to aforementioned VBA code) gets jumbled up.
So basically I want a PivotTable.pivotfield position for all scenarios in chronological order (either all six of them are present or in cases where less than 6 are present)
Thing is I want to have 0-30 in 1st position, 31-60 days in 2nd position and so.
Simple thing which I write is
ActiveSheet.PivotTables("PivotTable12").PivotFields("0-30 days").position = 1,
ActiveSheet.PivotTables("PivotTable12").PivotFields("31-60 days").position = 2 and so in chronological order
But the issue is there are times when 31-60 days / 61-90 days /or any one or more of the above column field may not be present at all.
i..e, there might be only two fields in those scenario say , 61-90 days and 91-120 days (then 61-90 days should be first and 91-120 days should be second).
In the above scenario, my position (due to aforementioned VBA code) gets jumbled up.
So basically I want a PivotTable.pivotfield position for all scenarios in chronological order (either all six of them are present or in cases where less than 6 are present)