"IN" comparison operator

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know VBA doesn't have an "IN" comparison operator like many languages. I
was wondering if there is a function that has been written that emulates
"IN".
 
Sub Tester1()
v = Array("dog", "cat", "barn", "house", "home")
res = Application.Match("house", v, 0)
If Not IsError(res) Then
MsgBox "House is item number: " & res
Else
MsgBox "House not found"
End If


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top