[Previous] [Contents] [Next]

Control the Sort Order with AutoSort


The Excel user interface offers an AutoSort option that enables you to show markets in descending order based on revenue. The equivalent code in VBA to sort the customer field by descending revenue uses the AutoSort method:

PT.PivotFields("Line of Business").AutoSort Order:=xlDescending, _
    Field:="Sum of Revenue"


[Previous] [Contents] [Next]