PivotFormulas.Add Method (Excel)
Creates a new PivotTable formula.
Syntax
expression .Add(Formula, UseStandardFormula)
expression A variable that represents a PivotFormulas object.
Parameters
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
Formula |
Required |
String |
The new PivotTable formula. |
UseStandardFormula |
Optional |
Variant |
A standard PivotTable formula. |
Return Value
A PivotFormula object that represents the new PivotTable formula.
Example
This example creates a new PivotTable formula for the first PivotTable report on worksheet one.
Worksheets(1).PivotTables(1).PivotFormulas _
.Add "Year['1998'] Apples = (Year['1997'] Apples) * 2"