CalculatedFields Collection Object

Description

A collection of PivotField objects that represents all the calculated fields in the specified PivotTable. For example, a PivotTable that contains Revenue and Expense fields could have a calculated field named "Profit" defined as the amount in the Revenue field minus the amount in the Expense field.

Using the CalculatedFields Collection

Use the CalculatedFields method to return the CalculatedFields collection. The following example deletes the calculated fields from PivotTable one.

For Each fld in Worksheets(1).PivotTables("Pivot1").CalculatedFields
    fld.Delete
Next
Use CalculatedFields(index), where index is the specified field's name or index number, to return a single PivotField object from the CalculatedFields collection.

Properties

Application property, Count property, Creator property, Parent property.

Methods

Add method (CalculatedFields or CalculatedItems collection), Item method (CalculatedFields collection).