Galileo
Electrical
- Jan 11, 2002
- 3
Is it possible, in VBA, to pass the name of a function (or a subroutine) to a subroutine through the argument list? In FORTRAN it's possible to have a function name as one of the arguments of a subroutine. For example, when writing a subroutine to find the roots of an arbitrary function, one typically does something like this:
SUBROUTINE rootfinder(root,guess1,guess2,functionname)
declarations, etc.
a=functionname(guess1)
b=functionname(guess2)
etc.
I haven't had any luck doing this in VBA. Does anyone know how to do this, or if there's a convenient work-around?
SUBROUTINE rootfinder(root,guess1,guess2,functionname)
declarations, etc.
a=functionname(guess1)
b=functionname(guess2)
etc.
I haven't had any luck doing this in VBA. Does anyone know how to do this, or if there's a convenient work-around?