Subtotals Property

Applies To

PivotField Object.

Description

Returns or sets an array of Boolean values corresponding to the subtotals showing with the specified field. This property is valid only for non-data fields. Read-write.

Remarks

This property returns an array of Boolean values, as shown in the following table.

Array element

Meaning

1

Automatic

2

Sum

3

Count

4

Average

5

Max

6

Min

7

Product

8

Count Nums


Array element

Meaning

9

StdDev

10

StdDevp

11

Var

12

Varp


If an element is True, the field shows that subtotal. If element one (Automatic) is True, all other values are set to False.

Example

This example sets the field that contains the active cell to show Sum subtotals.


Worksheets("Sheet1").Activate
ActiveCell.PivotField.Subtotals = _
    Array(False, True, False, False, False, False, _
    False, False, False, False, False, False)