PivotField.AutoShow (Excel)

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

AutoShow (Type, Range, Count, Field)


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

Arguments

The following arguments are required:

Type (Long) - Use the xlAutomatic constant to cause the specified PivotTable report to show the items that match the specified criteria. Use xlManual to disable this feature.

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

Count (Long) - The number of items to be shown.

Field (String) - The name of the base data field. You must specify the unique name (as returned from the SourceName property), and not the displayed name.