Propiedad PivotCell.CustomSubtotalFunction (Excel)

Devuelve el valor del campo de función de subtotal personalizado de un objeto PivotCell. XlConsolidationFunction de solo lectura.

Sintaxis

expresión. CustomSubtotalFunction

Expresión Variable que representa un objeto PivotCell .

Comentarios

La propiedad CustomSubtotalFunction devuelve un error si el tipo de objeto PivotCell no es un subtotal personalizado. Esta propiedad sólo se aplica a los datos cuyo origen no sea OLAP.

Ejemplo:

En este ejemplo se determina si la celda C20 contiene una función subtotal personalizada que usa una función de consolidación de count y, a continuación, se lo notifica al usuario. Se supone que existe una tabla dinámica en la hoja de cálculo activa.

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

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.