We know an Excel function “FORMULATEXT” which converts Formula into Text. What if you want to do the reverse i.e. convert excel text into active formula?
Let’s say your Excel cell has following string or text.
A1+B1
Now you want to convert the above text into active formula that evaluates it instead of just printing text.
Excel doesn’t have a built-in function that directly convert text strings to active formulas, However, using a simple VBA script, you can create a custom function that does the same.
The following VBA script converts the text or string into an active formula that gets actually evaluated.
Function Eval(ByVal formulaText As String) As Variant
On Error Resume Next
Eval = Evaluate(formulaText)
End Function
To use the above VB code in Excel Workbook, follow these steps
Presently this formula is only available in present sheet. To make it available in all Excel sheets follow steps provided here.
Use Eval function defined above to evaluate or convert text into active formula.
The Sieve of Eratosthenes is a popular algorithm used to find all prime numbers up…
Introduction Have you ever wondered about numbers that don't quite fit in with the rest?…
Struggling to remember the capitals of countries? Well, you’re not alone. Today, we’re going to…
Works with Microsoft® Word® 2010, 2013, 2016, 2019, 2021, 365 and above Upside down question mark (¿)…
Microsoft Word has different ways to add symbol. Nabla symbol (∇) is one of the…
Broken keys in your keyboard or just want to remap keys in Windows no need…