DataAxis Property Example

This example adds a total to the PivotTable list in the active view and inserts a field set on the data axis.

Set view = PivotTable1.ActiveView
Set c = PivotTable1.Constants

Set newTotal = view.AddTotal("myTotal", view.FieldSets("Freight").Fields(0), c.plFunctionSum)
view.DataAxis.InsertTotal newTotal
view.DataAxis.InsertFieldSet view.FieldSets("OrderDate")