you need to create Function that Evaluate Expression and produce result according to stirng expression like below is example of it
Function EvalExpression(ByVal expression As String) As Double
Dim result As Double
Dim operand As Double
Dim opcode As String
Dim index As Integer
Dim lastIndex As Integer
' the null character mark the end of the string
expression = expression & vbNullChar
For index = 1 To Len(expression) + 1
If InStr("+-*/" & vbNullChar, Mid$(expression, index, 1)) Then
If lastIndex = 0 Then
' this is the first operand in the expression
result = Val(Left$(expression, index - 1))
Else
' extract the new operand
operand = Val(Mid$(expression, lastIndex, index - lastIndex))
' execute the pending operation
Select Case opcode
Case "+"
result = result + operand
Case "-"
result = result - operand
Case "*"
result = result * operand
Case "/"
result = result / operand
End Select
End If
opcode = Mid$(expression, index, 1)
lastIndex = index + 1
End If
Next
EvalExpression = LTrim$(result)
End Function