ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Executing a formula? (https://www.excelbanter.com/excel-programming/316874-executing-formula.html)

J S

Executing a formula?
 
Is there anyway to write a function that takes as input a string containing
a formula and then somehow executes it and returns the value?

MyExecuteFunction("sum(a2:c5)")

I basically want the user to write out a normal worksheet formula and then I
need to parse this formula, make some changes and return back the value.

Is there anyway to do this?



Frank Kabel

Executing a formula?
 
Hi
application.evaluate
e.g
msgbox application.evaluate("=SUM(A2:C5)")

--
Regards
Frank Kabel
Frankfurt, Germany


J S wrote:
Is there anyway to write a function that takes as input a string
containing a formula and then somehow executes it and returns the
value?

MyExecuteFunction("sum(a2:c5)")

I basically want the user to write out a normal worksheet formula and
then I need to parse this formula, make some changes and return back
the value.

Is there anyway to do this?




All times are GMT +1. The time now is 12:02 PM.

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