title: check if array is empty (vba excel)
body: <p>These if ... then statements are getting the wrong results in my opinion. The first is returning the value 'false' when it should be 'true'. The fourth returns the right value. The second and third return an error.     </p>
  
  <pre><code>Sub empty_array()
    Dim arr1() As Variant
  
    If IsEmpty(arr1) Then
      MsgBox "hey"
    End If
  
    If IsError(UBound(arr1)) Then
      MsgBox "hey"
    End If
  
    If IsError(Application.match("*", (arr1), 0)) Then
      MsgBox "hey"
    End If
  
    ReDim arr1(1)
    arr1(1) = "hey"
  
    If IsEmpty(arr1) Then
      MsgBox "hey"
    End If
  End Sub
  </code></pre>