kylefoley76
Well-known Member
- Joined
- Mar 1, 2010
- Messages
- 1,553
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 second returns the right value. The third and fourth return an error.
Code:
Sub empty_array()
Dim arr1() As Variant
If IsEmpty(arr1) Then
MsgBox "hey"
End If
ReDim arr1(1)
arr1(1) = "hey"
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
End Sub