次の方法で共有


PivotField.AutoShowType Property (Excel)

Returns xlAutomatic if AutoShow is enabled for the specified PivotTable field; returns xlManual if AutoShow is disabled. Read-only Long.

Syntax

expression .AutoShowType

expression A variable that represents a PivotField object.

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

See Also

Concepts

PivotField Object

PivotField Object Members