PivotField.IsMemberProperty 属性 (Excel)

如果数据透视表字段包含成员属性,则返回 True。 只读 Boolean

语法

表达式IsMemberProperty

表达 一个代表 PivotField 对象的变量。

备注

如果没有使用联机分析处理 (OLAP) 数据源,则该属性将返回一个运行时错误。

示例

本示例确定数据透视表字段是否包含成员属性,并通知用户。 本示例假定数据透视表位于活动的工作表上,并与 OLAP 数据源相连。

Sub CheckForMembers() 
 
 Dim pvtTable As PivotTable 
 Dim pvtField As PivotField 
 
 Set pvtTable = ActiveSheet.PivotTables(1) 
 Set pvtField = pvtTable.PivotFields(1) 
 
 ' Determine if member properties exist and notify user. 
 If pvtField.IsMemberProperty = True Then 
 MsgBox "The PivotField contains member properties." 
 Else 
 MsgBox "The PivotField does not contain member properties." 
 End If 
 
End Sub

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。