Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.09 KB

Excel.PivotField.Calculation.md

File metadata and controls

41 lines (26 loc) · 1.09 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
PivotField.Calculation property (Excel)
vbaxl10.chm240074
vbaxl10.chm240074
Excel.PivotField.Calculation
abdf0109-da46-1cf6-6f09-c4ba7a3baebd
05/04/2019
medium

PivotField.Calculation property (Excel)

Returns or sets an XlPivotFieldCalculation value that represents the type of calculation performed by the specified field. This property is valid only for data fields.

Syntax

expression.Calculation

expression A variable that represents a PivotField object.

Example

This example sets the data field in the PivotTable report on Sheet1 to calculate the difference from the base field, sets the base field to the field named ORDER_DATE, and then sets the base item to the item named 5/16/89.

With Worksheets("Sheet1").Range("A3").PivotField 
    .Calculation = xlDifferenceFrom 
    .BaseField = "ORDER_DATE" 
    .BaseItem = "5/16/89" 
End With

[!includeSupport and feedback]