PivotField.CalculatedItems method (Excel)
Returns a CalculatedItems collection that represents all the calculated items in the specified PivotTable report. Read-only.
Syntax
expression.CalculatedItems
expression A variable that represents a PivotField object.
Return value
CalculatedItems
Remarks
For OLAP data sources, this method returns a zero-length collection.
Example
This example creates a list of calculated items and their formulas.
Set pt = Worksheets(1).PivotTables(1)
For Each ci In pt.PivotFields("Sales").CalculatedItems
r = r + 1
With Worksheets(2)
.Cells(r, 1).Value = ci.Name
.Cells(r, 2).Value = ci.Formula
End With
Next
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.