Hi, hopefully a quick one..
Is there something I can add my VBA to stop the pivot table that it is in from resorting
pt4 is the PivotTable shown
"sumfield" is either "Pax" or "Revenue" as I want to be able to select between the two, but when it changes it resorts it.
Basically, whatever it's a "Sum of.." needs to be sorted Largest to Smallest on the Grand Total.
Is there something I can add my VBA to stop the pivot table that it is in from resorting
Code:
pt4.DataFields(1).Orientation = xlHidden
pt4.PivotFields(sumField).Orientation = xlDataField
pt4 is the PivotTable shown
"sumfield" is either "Pax" or "Revenue" as I want to be able to select between the two, but when it changes it resorts it.
Basically, whatever it's a "Sum of.." needs to be sorted Largest to Smallest on the Grand Total.