Share via


PivotField.Subtotals Property

Returns or sets subtotals displayed with the specified field. Valid only for non-data fields. Read/write Object.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Property Subtotals ( _
    Index As Object _
) As Object
    Get
    Set
'Usage
Dim instance As PivotField
Dim Index As Object
Dim value As Object

value = instance.Subtotals(Index)

instance.Subtotals(Index) = value
Object this[
    Object Index
] { get; set; }

Parameters

  • Index
    Type: System.Object

    Optional Object. A subtotal index, as shown in the following table. If this argument is omitted, the Subtotals method returns an array that contains a Boolean value for each subtotal.

    Index

    Meaning

    1

    Automatic

    2

    Sum

    3

    Count

    4

    Average

    5

    Max

    6

    Min

    7

    Product

    8

    Count Nums

    9

    StdDev

    10

    StdDevp

    11

    Var

    12

    Varp

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

Property Value

Type: System.Object

Remarks

For OLAP data sources, Index can only return or be set to 1 (Automatic). The returned array always contains True or False for the first array element, and it contains False for all other elements. An array of element values that are all False indicates that there are no subtotals.

See Also

Reference

PivotField Interface

PivotField Members

Microsoft.Office.Interop.Excel Namespace