Remarks

A report 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.

For OLAP data sources, you cannot set this collection, and it always returns Nothing.

Use the method to return the CalculatedFields collection .

Use CalculatedFields(), where is specified field's name or index number, to return a single PivotFieldobject from the CalculatedFieldscollection.

Example
The following example deletes the calculated fields from the PivotTable report named "Pivot1"

Visual Basic for Applications
For Each fld in _ Worksheets(1).PivotTables("Pivot1").CalculatedFields fld.Delete Next
Calculated Fields Collection Object CalculatedField Collection CalculatedField Collection Object

See also:

index index