AutoShowRange Property

Applies To

PivotField object.

Description

Returns xlTop if the top items are shown automatically in the pivot field; returns xlBottom if the bottom items are shown. Read-only Long.

Example

This example displays a message box showing the AutoShow parameters for the Salesman field.

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 is showing " & rn & " " & _
            .AutoShowCount & " items in " & .Name & _
            " field by " & .AutoShowField
    Else
        MsgBox "Pivot table is not using AutoShow for this field"
    End If
End With