View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Pivot Field Function Code

Hi Todd
AFAIK this is not possible (you can't use custom function if you use
the wizard)

--
Regards
Frank Kabel
Frankfurt, Germany


Todd Huttenstine wrote:
hey guys

Below is a the code I use to calculate (summarize) a
particular pivot field in my pivot table:

With ActiveSheet.PivotTables("PivotTable1").PivotFields
("% Overdue")
.Orientation = xlDataField
.Caption = "Percent Overdue"
.Position = 1
.Function = xlAverage
End With

As you can see the .Function tells the field how to
calculate.

Is it possible to put a custom formula in there such as:
.Function = (Total28- 'On Time28')/ Total28


When I do this VBA highlights it in red. Is there a way
to do this?



Thank you
Todd Huttenstine