The CreatePivotFields method is new in Microsoft Office Excel 2007. It enables users to apply a filter to PivotFields not yet added to the PivotTable by creating the corresponding PivotField object.
Version Information Version Added: Excel 2007
Syntax
expression.CreatePivotFields
expression A variable that represents a CubeField object.
Remarks
In OLAP PivotTables, PivotFields do not exist until the corresponding CubeField is added to the PivotTable. The CreatePivotFields method enables users to create all PivotFields of a CubeField. Users can also add filters to the PivotFields and set properties on them before the CubeField is added to the PivotTable.
Example
Visual Basic for Applications
Sub FilterFieldBeforeAddingItToPivotTable()
ActiveSheet.PivotTables("PivotTable1").CubeFields("[Date].[Fiscal]").CreatePivotFields