DeleteTotal Method

Microsoft Office Web Components Visual Basic

Deletes a PivotTotal object from the PivotTotals collection. You can delete only user-defined totals.

expression.DeleteTotal(Total)

expression    An expression that returns a PivotView object.

Total    Required Variant. Specifies the name or number of the total.

Example

This example deletes a total named "Total Budget" from PivotTable1.

Sub Delete_Total()
    Dim vwView

    Set vwView = PivotTable1.ActiveView

    ' Delete the total named "Total Budget."
    vwView.DeleteTotal vwView.Totals("Total Budget")
End Sub