Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 1.54 KB

Excel.PivotField.AutoShow.md

File metadata and controls

45 lines (30 loc) · 1.54 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
PivotField.AutoShow method (Excel)
vbaxl10.chm240112
vbaxl10.chm240112
Excel.PivotField.AutoShow
8caea6de-8872-c474-38bd-8d6d78d9f0cc
05/04/2019
medium

PivotField.AutoShow method (Excel)

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

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 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 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 SourceName property), and not the displayed name.

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"

[!includeSupport and feedback]