Syntax

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

expression A variable that represents a PivotField object.

Parameters

Name Required/Optional Data Type Description
Type Required Long Use xlAutomatic to cause the specified PivotTable report 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. You must specify the unique name (as returned from the property), and not the displayed name.

Example

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

Visual Basic for Applications
ActiveSheet.PivotTables("Pivot1").PivotFields("Company") _ .AutoShow xlAutomatic, xlTop, 2, "Sum of Sales"
auto show Auto Show Method AutoShow AutoShow Method Discriminate pivot table based on certain number of best entries? Display only the best or worst data in pivot table? Restrict pivottable data to maximum or minimum items? Show only the top four pivot items?

See also: