title: passing an integer and an array of integers to a VBA function
body: <p>I'm trying to pass an integer and an array of integers to a function to check whether the integer is a member of the array.The arrowed line gives a compile error msg as: "expect:= ".</p>
  
  <pre><code>Public Sub mainSub()
  B = Array(4, 5, 6, 7, 8, 9)
  ckArr(4,B) '&lt;-------
  End Sub
  
  Public function ckArr(N As Integer, A() As Integer)
  For i = 0 To UBound(A)
  If N = A(i) And i &lt;= UBound(A) Then
      Debug.Print N; " Is in the List"
      Exit For 'Do
  ElseIf i &lt; UBound(A) Then GoTo NXT
  Else:
      Debug.Print N; " Is NOT in the List"
      Exit For 'Do
  End If
  NXT:
  'i = i + 1
  Next 'Loop
  End function
  </code></pre>