View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
puff puff is offline
external usenet poster
 
Posts: 6
Default pivot table calculated field with user function

Is it possible/how do I use a user function for a pivot table
calculated field? Something like the following:

With pt
.AddFields RowFields:="Vendor", ColumnFields:="Channel"
.PivotFields("Name").Orientation = xlDataField
.CalculatedFields.Add name:="BlueBox",
Formula:="=CountBlueBox(Name,Channel)"
With .PivotFields("BlueBox")
.Orientation = xlDataField
End With
End With

I don't seem to understand how to specify the function CountBlueBox as
the Formula.