In VBA, is there a way to create a function which receives one of it's parameters as a string with a condition to be evaluated by an IF block?
This should give an idea of what I am looking for, but I now it's not that simple:
Function StringAsCondition(a As String) As Boolean
Dim result As Boolean
Dim b As Long
Dim c As Long
b = 4
c = 2
If a Then
result = True
End If
StringAsCondition = result
End Function
Sub Test()
Dim a As String
a = "b >= c"
Dim functionresult As Boolean
functionresult = StringAsCondition(a)
MsgBox functionresult
End Sub