VB Code:

Public A As Integer, B As Integer, C as Integer, ...

Public Formula As String

Public Function FormulaBasher() As String

Dim FormulaScript As New ScriptControl

FormulaScript.Language = "VBScript"

A = 10

B = 5

C = 3

'...

Formula = "(A+B) * C + A"

'Replace the variables with their values.

Formula = Replace(Formula, "A", A)

Formula = Replace(Formula, "B", B)

Formula = Replace(Formula, "C", C)

'...

'temporary code, so you can see the changes have been made:

MsgBox formula

FormulaBasher = CStr(FormulaScript.Eval(Formula))

End Function