PivotField.PropertyParentField property (Excel)
Returns a PivotField object representing the field to which the properties in this field pertain.
Syntax
expression.PropertyParentField
expression A variable that represents a PivotField object.
Remarks
Valid only for fields that are member property fields.
If the IsMemberProperty property is False, using the PropertyParentField property returns a run-time error.
Example
This example determines if there are member properties in the fourth field, and if there are, which fields the properties pertain to. Depending on the findings, Excel notifies the user. This example assumes that a PivotTable exists on the active worksheet and that it is based on an Online Analytical Processing (OLAP) data source.
Sub CheckParentField()
Dim pvtTable As PivotTable
Dim pvtField As PivotField
Set pvtTable = ActiveSheet.PivotTables(1)
Set pvtField = pvtTable.PivotFields(4)
' Check for member properties and notify user.
If pvtField.IsMemberProperty = False Then
MsgBox "No member properties present."
Else
MsgBox "The parent field of the members is: " & _
pvtField.PropertyParentField
End If
End Sub
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.