Excel equivalent to Eval function

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

Guest

In javascript I could concatenate strings and then execute the result as a
single command using the EVAL() function. I'd like to be able to do the same
in excel, but have yet to find a way of doing so. Compatibility with Excel 97
is not necessary, only 2000 onwards.

Does anybody here have a way of acheiving this?
 
You can use the EVALUATE (Application.Evaluate or Worksheet.Evaluate)
method, but this executes strings as Excel formulae rather than VBA
statements.

MsAccess has an EVAL function which will interpret VBA strings, but there is
no exact equivalent in Excel.
 
The code you reference also executes strings as Excel formulae in a rather
more long-winded way than using Excel Evaluate.

Charles
___________________________________
The Excel Calculation Site
http://www.decisionmodels.com
 
Back
Top