title: Check if a value is in an array or not with Excel VBA
body: <p>I've got some code below, that is supposed to be checking if a value is in an Array or not.</p>
  
  <pre><code>Sub test()
      vars1 = Array("Examples")
      vars2 = Array("Example")
      If IsInArray(Range("A1").Value, vars1) Then
          x = 1
      End If
  
      If IsInArray(Range("A1").Value, vars2) Then
          x = 1
      End If
  End Sub
  
  Function IsInArray(stringToBeFound As String, arr As Variant) As Boolean
    IsInArray = (UBound(Filter(arr, stringToBeFound)) &gt; -1)
  End Function
  </code></pre>
  
  <p>If the cell <code>A1</code> contains the word <code>Examples</code> for some reason both of the <code>IsInArray</code> detects it as existing for both Arrays when it should only find it existing in the <code>vars1</code> array</p>
  
  <p>What do I need to change to make my <code>IsInArray</code> function to make it an exact match?</p>