19 February 2014

Got a formula in excel cell as text and you want it to work as a formula? here is how to do it

When you have a formula in excel as text, and we want to parse it as a formula.
use this steps to do it:

1. For a simple example, text in cell A1 is like this  ="=B1+C1"
2. Press alt+F11 to open Excel VBA
3. Insert new module to that excel file
4. Put this on the module text window
Function Eval(Ref As String)
    Application.Volatile
    Eval = Evaluate(Ref)
End Function
5. Save & close it.
6. Change the text in A1 into something like : =Eval("=B1+C1")
7. Just click enter then it would run the module that we have inserted to it.


No comments:

Post a Comment

Twiit.. Twiit... Gulp