Share via


PivotMemberProperty Object

Multiple objects
PivotMemberProperty

Represents a member property for a PivotTable member. A member property is a custom property that has been defined for the member in an OLAP cube.

Using the PivotMemberProperty object

The following properties return a PivotMemberProperty object:

The PivotMemberProperties collection's Item property

The PivotResultMemberProperty object's MemberProperty property

Use the DisplayIn property to control whether the specified member property is displayed in the PivotTable list, ScreenTip, both the PivotTable list and ScreenTip, or not at all. Use the Caption property to set the caption for a member property.

The following example sets the captions of, and then displays the member captions of the Store Name field.

Sub DisplayMemberProperties()

    Dim ptView
    Dim ptConstants
    Dim fldStoreName

    Set ptConstants = PivotTable1.Constants

    ' Set a variable to the active view of the PivotTable.
    Set ptView = PivotTable1.ActiveView

    ' Set a variable to the Store Name field.
    Set fldStoreName = ptView.FieldSets("Store").Fields("Store Name")

    ' The following three lines of code specify that the member properties are
    ' displayed in the PivotTable list.
    fldStoreName.MemberProperties("Store Manager").DisplayIn = ptConstants.plDisplayPropertyInReport
    fldStoreName.MemberProperties("Store Type").DisplayIn = ptConstants.plDisplayPropertyInReport
    fldStoreName.MemberProperties("Store Sqft").DisplayIn = ptConstants.plDisplayPropertyInReport

    ' The following three lines of code set the caption for the member properties.
    fldStoreName.MemberProperties("Store Manager").Caption = "Manager Name"
    fldStoreName.MemberProperties("Store Type").Caption = "Store Type"
    fldStoreName.MemberProperties("Store Sqft").Caption = "Size in SQFT"

End Sub

Properties | Caption Property | DisplayIn Property | IsIncluded Property | Name Property | NumberFormat Property

Parent Objects | PivotMemberProperties Collection | PivotResultMemberProperty Object

Child Objects