Reputation: 799
I will have to do arithmetic operation from the below string by using VBscript.
s = "1+2-3+4"
output => 4
Thanks in advance!
Upvotes: 0
Views: 80
Reputation: 1895
VBScript, use the eval method
Example
total = Eval("1+2-3+4")
Excel VBA, use evaluate method Example
total = Evaluate("1+2-3+4")
Upvotes: 4