Excel equivalent to Eval function

P

PatrickS

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?
 
C

Charles Williams

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.
 
C

Charles Williams

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top