如何使用VBA按certan Grand Total列对数据透视表进行排序?

时间:2018-02-01 12:37:43

标签: excel excel-vba pivot-table vba

到目前为止,这是我的代码,但它并没有做我需要它做的事情,这是按照名为&#34的总计Total列排序的" RevVarLY的总和"。

 ThisWorkbook.Worksheets("3").PivotTables("PivotTable3").PivotFields("RevVarLY").AutoSort Order:=xlDescending, Field:="Total Sum of RevVarLY"

1 个答案:

答案 0 :(得分:0)

The Values Fields can only be sorted by the 'natural' groupings formed by the fields to the immediate left. If you only have one row field, then you can do what you want. If you have more, then you can't.