AutoSortOrder 属性

       

返回用于对指定数据透视表字段进行自动排序的次序。 可为以下 XlSortOrder 常量之一。Long 类型,只读。

expression.AutoSortOrder

expression   必需。该表达式返回“应用于”列表中的对象之一。

示例

本示例在消息框中显示“Product”字段的 AutoSort 参数值。

With Worksheets(1).PivotTables(1).PivotFields("product")
    Select Case .AutoSortOrder
        Case xlManual
            aso = "manual"
        Case xlAscending
            aso = "ascending"
        Case xlDescending
            aso = "descending"
    End Select
    MsgBox " sorted in " & aso & _
        " order by " & .AutoSortField
End With