For example:
Dim name As String: name = "NaN"
' Doesn't generate an error:
If IsNumeric(name) Then
Dim iv As Integer: iv = CInt(name)
If iv > 0 Then
' Do something
End If
End If
' Does generate error 13 on 'CInt(name)': Types don't match
If IsNumeric(name) And CInt(name) > 0 Then
' Do something
End If
Why is the second condition CInt(name) > 0
even evaluated with the single if statement? Or is this just what VBA does? I'm used to write C# code which doesn't have this kind of behavior.