Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to write the following code:
dim s as variant ' or as string dim x as double ' or as variant s = "1+2+3" x = someFunction(s) debug.print "-----" & chr(10) & s & chr(10) & x What is "someFunction"? That is, what VBA function takes a numeric expression in string form, evaluates it and returns the numerical result as if I entered the expression directly (e.g. x=1+2+3)? Obviously, I could do the above by writing the expression in two places, namely: s = "1+2+3" x = 1+2+3 But since I am experimenting with the expression, I would like be able to modify it in just one place to ensure that "what you see is what you get" (i.e. I do not make the mistake of modifying only one instance of the expression). |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
evaluate a concatenate expression | Excel Worksheet Functions | |||
evaluate a year expression | Excel Programming | |||
Evaluate Custom Expression | Excel Programming | |||
Giving the String expression for Numeric Values.... | Excel Programming | |||
How to evaluate a text expression as formula ? | Excel Programming |