I'm looking for something similar to the solution posted here:
Excel function that evaluates a string as if it were a formula?
Problem is this does not seem to work with a function in there.
This is the function in that thread as submitted by chris neilsen:
Function ev(r As Range) As Variant
ev = Evaluate(r.Value)
End Function
Here is an example of a string I would like to turn into a formula:
=(INDEX(DataV,1,4)/INDEX(DataV,2,4))*100
DataV is a name within the spreadsheet.
I'm not sure how to do it, maybe I'll figure it out, right now it's looking like I probably won't unless I read a lot more about VBA.
Any help is appreciated.
Best Answer
Just thought I'd share the solution I eventually went with since it does the job. Couldn't make a user defined function that does this, doesn't seem to be possible so I went with a basic macro.
This one was written to be used with a button, if you wish for an automatic running macro look around this site for tips on using intersect.
The important part for the problem is question is:
Just define the formula of the cell as the value of the one with the string
In my case I wanted to have it run through a bunch of cells, hence the need to activate the equivalent to Range1 and using ActiveCell.Offset to define the Range2 equivalent
Works with any string, functions do need to be written in English though. Hope this helps.