Public Function ZeroLength(InputVar As Variant) As Boolean
'....................................................................
' This simple function checks the variant, of any type,
' for either Null or zero-length string.
' Null variants will return True, "zero-length."
' Uninitialized variants will return True, "zero-length."
' If the variant is detected as a 'string,' the variable is then tested for length:
' If the string length is zero, it returns True, "zero-length."
' Otherwise, it returns False, NOT "zero-length."
' Other data types return False by default, as they contain a value (even if zero).
' Created by HalloweenWeed 12/18/2019.
'....................................................................
If VarType(InputVar) < 2 Then
ZeroLength = True 'Case: Null or uninitialized
Else
If VarType(InputVar) = vbString Then 'Case: String
If Len(InputVar) < 1 Then
ZeroLength = True 'Case: Null string
Else
ZeroLength = False
End If
Else
ZeroLength = False
End If
End If
ExitFunction:
Exit Function
End Function