title: UBound Value of Filter Output in VBA
body: <p>I want to search a 1D array for a value, and I've been trying to do this using the filter function, but when I write a small sub to test this, it doesn't work and I get a "type mismatch" error.</p>
  
  <p>Can anyone tell me what's wrong in this code?</p>
  
  <pre><code>Dim range1() As Variant
  range1 = Sheet4.range("B3:B7")
  
  Dim string1 As String
  string1 = "hello"
  
  If UBound(Filter(range1, string1)) &gt;= 0 Then
      Sheet4.range("A1").Value = "Hello exists."
  Else
      Sheet4.range("A1").Value = "Hello does not exist."
  End If
  </code></pre>
  
  <p>Hello appears once in the selected range, so the result of the Ubound function should be 0, right?</p>