View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
James B James B is offline
external usenet poster
 
Posts: 3
Default VBA - Passing a FUNCTION as an Argument

Some expert help is required on this one. I want to
create a VBA function that calculates the derivative of
another function between two points.

The syntax would be something like the following:

Gradient = DerFun(Height(), x1, x2)

where

Function DerFun(Arg_Function as function, point1, point2)
DerFun=(Arg_Function(point2)-ArgFunction(point1))/ _
(point2-point1)
End Function

What is the proper syntax, instead of "Arg_Function as
Function"?