DataAxis Property

Microsoft Office Web Components Visual Basic

Returns a PivotDataAxis object that represents the data axis. Use the PivotDataAxis object returned by this property to insert fields and totals on the data axis of a PivotTable list. Read-only.

Example

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

Sub InsertTotal()
    Dim ptView
    Dim ptConstants
    Dim totNewtotal
    
    Set ptView = PivotTable1.ActiveView
    Set ptConstants = PivotTable1.Constants

    Set totNewTotal = view.AddTotal("myTotal", view.FieldSets("Freight").Fields(0), _
                                    ptConstants.plFunctionSum)
    
    ptView.DataAxis.InsertTotal totNewTotal
    ptView.DataAxis.InsertFieldSet ptView.FieldSets("OrderDate")
End Sub