Evaluate Expression Excel VBA (Visual Basic for Applications)

Evaluate Expression Excel VBA (Visual Basic for Applications)

Evaluate

Exposed by Application object. Evaluate is a VBA (Visual Basic for Applications) function takes one argument as Name and converts to an object or value. Evaluate function evaluate expression and pass it to Excel engine to determine result.

Expression

Application.Evaluate(name)

Code example

Public Function EvaluateExpress(oRange As Range) As String
    EvaluateExpress = 0
On Error GoTo errh
    EvaluateExpress = Evaluate(oRange.Value)
errh:
    If Err.Number <> 0 Then
    End If
End Function

Formula

Output

Next >> Excel Replace Vs. VBA Replace with code example

Leave a Reply

Your email address will not be published.