CalculatedFields 方法 (Excel)PivotTable.CalculatedFields method (Excel)

返回一个**CalculatedFields** 集合, 该集合代表指定数据透视表中的所有计算字段。Returns a CalculatedFields collection that represents all the calculated fields in the specified PivotTable report. 此为只读属性。Read-only.

语法Syntax

表达式CalculatedFieldsexpression.CalculatedFields

_表达式_一个代表**PivotTable** 对象的变量。expression A variable that represents a PivotTable object.

返回值Return value

CalculatedFieldsCalculatedFields

示例Example

本示例使计算结果字段不能被拖至行。This example prevents the calculated fields from being dragged to the row position.

For Each fld in _ 
 Worksheets(1).PivotTables("Pivot1") _ 
 .CalculatedFields 
 fld.DragToRow = False 
Next

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.