I was trying Google an answer for this question and couldn't find a good substitute for SQL's IN feature in VBA from the postings that came up.
In VBA the closest I could get to a construct of:
is:
That's okay, but does someone have a function to simulate SQL's 'in' statement in VBA? The idea is to replace the expression:
myVar = "abc" or myVar = "def" or myVar = "hgi" etc... with something like:
fnIn(myVar, "abc", "def", "hgi"... (string array)...)
In VBA the closest I could get to a construct of:
Code:
If myVar in("abc", "def", "hgi") then
'insert code here
End If
Code:
Select Case myVar
Case "abc", "def", "hgi"
'insert code here
End Select
myVar = "abc" or myVar = "def" or myVar = "hgi" etc... with something like:
fnIn(myVar, "abc", "def", "hgi"... (string array)...)
Comment