如果指定数据透视表字段自动显示首项,则返回 xlTop;如果自动显示末项,则返回 xlBottom。Long 类型,只读。
本示例在消息框中显示“Salesman”字段的 AutoShow 参数值。
With Worksheets(1).PivotTables(1).PivotFields("salesman")
If .AutoShowType = xlAutomatic Then
r = .AutoShowRange
If r = xlTop Then
rn = "top"
Else
rn = "bottom"
End If
MsgBox "PivotTable report is showing " & rn & " " & _
.AutoShowCount & " items in " & .Name & _
" field by " & .AutoShowField
Else
MsgBox "PivotTable report is not using AutoShow for this field"
End If
End With