Reference function name from a different cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to do something like this
=A1(B1:B10)
where A1=sum (or some function)
So I want excel to know the text value in A1 as the function name. Is this
possible?
 
If you can i've never heard/been able to. you can do it through code
something like this
Cells(1, 2) = "=" & Cells(1, 1).Text & "(B2:b5)"
 
Thanks, John,
Just to make sure I am doing this to make an array (so there is only one
equation that has different arguments/functions by referencing either
relative or absolute arguments for a thermodynamic add in to excel). Will
the array function still function properly when incorporated with VBA code?
 
There is an Evaluate function available in VBA which takes a string
that looks like an Excel formula (e.g. "=SUM(B1:B10)") and evaluates
it. This can easily be incorporated in a simple user-defined formula
(often called Eval - do a Google search for this), which would then
allow you to type:

=Eval(A1)

and if A1 contained the string the result will be the result of the
"string" formula.

Not exactly what you asked for, but it could easily be modified to
suit your situation.

Hope this helps.

Pete
 
Thanks Pete!

Pete_UK said:
There is an Evaluate function available in VBA which takes a string
that looks like an Excel formula (e.g. "=SUM(B1:B10)") and evaluates
it. This can easily be incorporated in a simple user-defined formula
(often called Eval - do a Google search for this), which would then
allow you to type:

=Eval(A1)

and if A1 contained the string the result will be the result of the
"string" formula.

Not exactly what you asked for, but it could easily be modified to
suit your situation.

Hope this helps.

Pete
 
Back
Top