'使用text1代替x,再将代数式值赋给y
'Microsoft Script调用系统函数实现表达式的运算
Function RESULT(ByVal x As String) As Double
Dim OBJ As Object
Set OBJ = CreateObject("MSScriptControl.ScriptControl")
OBJ.Language = "vbscript"
RESULT = OBJ.Eval(x)
Set OBJ = Nothing
End Function
Text3 = RESULT(Replace(Text2.Text,"x",Text1,,,vbTextCompare))