ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how to evaluate the content of a string as if it was a formula (https://www.excelbanter.com/excel-discussion-misc-queries/1365-how-evaluate-content-string-if-formula.html)

cyrille de brébisson

how to evaluate the content of a string as if it was a formula
 
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



Frank Kabel

Hi
not possible with VBA. Do you want to go this way?

--
Regards
Frank Kabel
Frankfurt, Germany

"cyrille de brébisson" schrieb im Newsbeitrag
...
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




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

"Frank Kabel" wrote in message
...
Hi
not possible with VBA. Do you want to go this way?

--
Regards
Frank Kabel
Frankfurt, Germany

"cyrille de brébisson" schrieb im Newsbeitrag
...
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






Peo Sjoblom

David McRitchie has some info here

http://www.mvps.org/dmcritchie/excel/formula.htm

scroll down to USEFORMULA


regards,

Peo Sjoblom

"cyrille de brébisson" wrote:

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




Frank Kabel

Hi
as said: Without a macro you can't evaluate strings

--
Regards
Frank Kabel
Frankfurt, Germany

"cyrille de brébisson" schrieb im Newsbeitrag
...
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

"Frank Kabel" wrote in message
...
Hi
not possible with VBA. Do you want to go this way?

--
Regards
Frank Kabel
Frankfurt, Germany

"cyrille de brébisson" schrieb im Newsbeitrag
...
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







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

"Peo Sjoblom" wrote:

David McRitchie has some info here

http://www.mvps.org/dmcritchie/excel/formula.htm

scroll down to USEFORMULA


regards,

Peo Sjoblom

"cyrille de brébisson" wrote:

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





All times are GMT +1. The time now is 04:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com