PivotCell.CustomSubtotalFunction 属性 (Excel)

返回 PivotCell 对象的自定义分类汇总函数字段的设置。 只读 XlConsolidationFunction

语法

表达式CustomSubtotalFunction

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

备注

如果 PivotCell 对象类型不是自定义小计,则 CustomSubtotalFunction 属性返回错误。 该属性只应用于非 OLAP 源数据。

示例

此示例确定单元格 C20 是否包含使用 count 合并函数的自定义小计函数,然后通知用户。 本示例假定数据透视表位于活动工作表上。

Sub UseCustomSubtotalFunction() 
 
 On Error GoTo Not_A_Function 
 
 ' Determine if custom subtotal function is a count function. 
 If Application.Range("C20").PivotCell.CustomSubtotalFunction = xlCount Then 
 MsgBox "The custom subtotal function is a Count." 
 Else 
 MsgBox "The custom subtotal function is not a Count." 
 End If 
 Exit Sub 
 
Not_A_Function: 
 MsgBox "The selected cell is not a custom subtotal function." 
 
End Sub

支持和反馈

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