DisplayInFieldList Property

Microsoft Office Web Components Object Model

DisplayInFieldList Property

       

Returns or sets whether the specified field set or total appears in the PivotTable Field List dialog box. Set this property to False to prevent the specified field set or total from appearing in the PivotTable Field List dialog box. The default value is True. Read/write Boolean.

expression.DisplayInFieldList

expression   Required. An expression that returns a PivotFieldSet or PivotTotal object.

Example

This example adds a new total to PivotTable1. The new total is formatted to display as a percentage of the parent row field, and will not appear in the PivotTable Field List dialog box.

Sub Add_Total()

    Dim vwView
    Dim ptConstants
    Dim totNewTotal

    Set vwView = PivotTable1.ActiveView
    Set ptConstants = PivotTable1.Constants

    ' Add a new total named "Total Budget" to the current view.
    Set totNewTotal = vwView.AddTotal("Total Budget", vwView.FieldSets("Budget").Fields(0), _
             ptConstants.plFunctionSum)

    ' Insert the newly created total into the detail area of the PivotTable.
    vwView.DataAxis.InsertTotal totNewTotal

    ' Show the totals as a percentage of the parent row field.
    totNewTotal.ShowAs = ptConstants.plShowAsPercentOfRowParent

    ' Do not display the new total in the PivotTable Field List dialog box.
    totNewTotal.DisplayInFieldList = False

End Sub