Hello,
I tried it and something else:
Sub OddStuff()
Dim mNum As Long, opStr As String, myCrit As Long
mNum = 4
opStr = "="
myCrit = 4
If Evaluate(mNum & opStr & myCrit) Then _
MsgBox "It Works! But not very well!"
End Sub
Sub ConventionalVB()
Dim mNum As String
Const MY_CRIT As Long = 4
Let mNum = "Month=4"
If Val(Mid$(mNum, InStr(1, mNum, "=", vbBinaryCompare) + 1, Len(mNum))) _
= MY_CRIT Then MsgBox "It Works!"
End Sub
Looks like OddStuff() is about ~450% slower on a single call and ~1,050%
slower on ten thousand calls, never mind the fact that it won't work in a
non-Excel environment.
If I was trying to parse a string, I might just do that.
Regards,
Nate Oliver