equation as text string and its numeric result

P

patryk

How can I type an equation in one cell as a text string eg. "2+3+(5+6)*6"
and get its result in the other one?
 
P

Pete_UK

Do a search of the newsgroups looking for Eval - you can define a User-
defined Function making use of Evaluate to do this.

Hope this helps.

Pete
 
G

Gary''s Student

Try this tiny UDF:

Function value_of(r As Range) As Variant
value_of = Evaluate("=" & r.Value)
End Function
 
Top