reference a function
Bill Brehm wrote...
Can I do something like this?
A B
1 =F(A1)
2 =F(A2)
3 =F(A3)
4 etc
....
and define a function in a cell called F, say maybe =sin(X)? This would give
me the ability to plot any function I can put in a cell.
The closest would be a udf like
Function F(a As Variant) As Variant
Dim fcn As String
Application.Volatile True
fcn = Evaluate("_F")
fcn = Replace(fcn, "$$", CStr(a))
F = Evaluate(fcn)
End Function
where _F would be a defined name referring to the actual function you
wanted to use, and $$ would be the token representing the argument to
F(). Note: you can't have both a udf named F and a defined name named F.
|