Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Working from a "Formula Table"

Status
Not open for further replies.

EdwardA

Programmer
May 22, 2002
15
GB
Hi,

I have a table which contains a text field populated with formulas:

For example:

"4*4 + (7*10)"
"5 * 1.175"

I am looping through this formula table and would like to assign the *answers* to the formulas into an array.

This is fine if I want to store the actual text of the formula in the array, but how do I store the answers to the formula in the array?

In other words how do I interpret the formula as a formula, not a string ...

Any advice gratefully received.

Rgds.

EdA.
 
You might want to take a look at the .Eval method of the Scripting Object

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
CajunCenturion - thanks, that it just what I was looking for... couldn't for the life of me remember if this functionality was available in VBA.
 
For the examples shown, Eval works as noted by CajunCenturion. In the more pratical (general) instance where the "formula" would include some parameter(s) to be filled in at run-time, you need to do additional 'translation' from the parameter(s) name(s) to the values supplied in the parameters. This complicates the overall process a bit and -in MY opinion- significantly reduces the utility of what you are discussing.

See 'advanced' help in these fora, using the term "Eval". It will return a number of threads illustrating various aspects / uses of the method.





MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top