Convert text containing numbers and simple arithmatic (+-*/) to value

  • Thread starter Thread starter James L.McMuray
  • Start date Start date
J

James L.McMuray

Is there a function that handles simple arithmatic text
strings and gives the resultant value as a number?

value(text) works for simple numbers, ie. No arithmatic

I want to process the string "2*3*4+5*8+2" to yield the
number 54
 
Hi
you may use the following user defined function:
Public Function eval_it(eval_str)
eval_it = Application.Evaluate(eval_str)
End Function

use is in your example like
=eval_it("=" & A1)
 
Back
Top