Hi!
I have a string(a) which consists of a number(5) and a variable(z). I replace z with 2 using replace function.
and I want to get 7 as result(x). Is there any function to get right result.
Thanks..
I have a string(a) which consists of a number(5) and a variable(z). I replace z with 2 using replace function.
and I want to get 7 as result(x). Is there any function to get right result.
Code:
Dim a As String
Dim x As Long
a = "(z + 5)"
a = Replace(a, "z", "2")
x = Val(a)
Thanks..