B
Bob
Hi Everyone:
In VB or VBA, is there anyway to send the name of a function as an argument
into a sub, and have that sub execute the function. For example
Private Sub Main()
call MySub(2,y,"F") 'or call MySub(2,y,F)
cells(1,1).value=y
End sub
Private sub MySub(x,y,FName)
y = 2*FName(x)
more code
End Sub
Private function F(x)
Some code
End function
I know I can write all these routine as one. However, the function F(x) is
a generic one that the user will supply. Is there any way of doing this?
Thanks for your help.
Bob
In VB or VBA, is there anyway to send the name of a function as an argument
into a sub, and have that sub execute the function. For example
Private Sub Main()
call MySub(2,y,"F") 'or call MySub(2,y,F)
cells(1,1).value=y
End sub
Private sub MySub(x,y,FName)
y = 2*FName(x)
more code
End Sub
Private function F(x)
Some code
End function
I know I can write all these routine as one. However, the function F(x) is
a generic one that the user will supply. Is there any way of doing this?
Thanks for your help.
Bob