Share via


ShowAsValue Property

Returns a Variant that represents the value of the specified PivotAggregate object without percentage formatting. Use this property to return the value of a cell's aggregate when the ShowAs property has been set to one of the following values: plShowAsPercentOfColumnParent, plShowAsPercentOfColumnTotal, plShowAsPercentOfGrandTotal, plShowAsPercentOfRowParent, plShowAsPercentOfRowTotal. Read-only.

expression.ShowAsValue

*expression   * Required. An expression that returns a PivotAggregate object.

Example

This example displays the aggregate for the third member of the row field in a message box.

Sub GetTotal()

    Dim ptData
    Dim pmRowMem
    Dim pmColMem

    ' Set a variable to the PivotTable data.
    Set ptData = PivotTable1.ActiveData

    ' Set a variable to the third item contained in the field
    ' that has been added to the row axis.
    Set pmRowMem = ptData.RowAxis.Member.ChildMembers(2)

    ' In this example, there are no fields on the column axis.
    Set pmColMem = ptData.ColumnAxis.Member

    ' Display the value of the aggregate.
    MsgBox ptData.Cells(pmRowMem, pmColMem).Aggregates(0).ShowAsValue

End Sub

Applies to | PivotAggregate Object

See Also | ShowAs Property