AutoShow Method

Applies To

PivotField object.

Description

Displays the number of top or bottom items for a PivotTable row, page, or column field.

Syntax

expression.AutoShow(Type, Range, Count, Field)

expression Required. An expression that returns a PivotField object.

Type Required Long. Use xlAutomatic to cause the PivotTable to show the items that match the specified criteria. Use xlManual to disable this feature.

Range Required Long. The location at which to start showing items. Can be either of the following constants: xlTop or xlBottom.

Count Required Long. The number of items to be shown.

Field Required String. The name of the base data field.

Example

This example shows only the top two companies, based on the sum of sales:

ActiveSheet.PivotTables("Pivot1").PivotFields("Company") _
    .AutoShow  xlAutomatic, xlTop, 2, "Sum of Sales"