how to evaluate the content of a string as if it was a formula

  • Thread starter cyrille de brébisson
  • Start date
C

cyrille de brébisson

hello.

I have a problem that I can not solve with excel.
I have a cell wich contain a string such as: "SIN(5)" (this is a STRING,
created using a formula).
now, I want to calculate this formula and place the result in another
string.
In short, I would like to find a function that does the same thing than
VALUE, but that is not limited to only number.

(more on my application:
I have one cel where the user can enter a formula such as SIN(X) as a
string.
I then have number from 1 to 1000 in column B and column C is
=SUBSITUTE($A$1,"X",$B1)
now, I want column D to be: =EVALUATE(C1) ...)

thanks for the help, cyrille
 
C

cyrille de brébisson

hello,

I was able to do a macro doing:
for i=0 to 1000
select("C"+i)
a= selection.value
select("d"+i)
selection.formula="="+a
next

but I would like to avoid having to do a macro...

cyrille
 
M

Markster

Hello Peo.

Since you are an MVP, could you politely address my questions under the post
labeled "Workbooks", directly below this post - thank you.

Markster
-----------
 

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