Answers for "excelvba Imitating the "IN" operator from python"

VBA
4

excel vba Imitating the "IN" operator from python

'VBA does not have an IN operator, but we can do this:

Function IsIn(a, b) As Boolean
    IsIn = InStr("," & b & ",", "," & a & ",")
End Function

'--------------------------------------------------------------------

MsgBox IsIn(2, "1,2,3")		  '<-- displays True
MsgBox IsIn("d", "a,b,c")	  '<-- displays False
Posted by: Guest on May-02-2020

Code answers related to "VBA"

Browse Popular Code Answers by Language