Test a Variant variable to see whether it has the Empty value : IsEmpty « Data Type Functions « VBA / Excel / Access / Word






Test a Variant variable to see whether it has the Empty value

 
Sub EmptyVar()
    Dim vntName As Variant
    Debug.Print IsEmpty(vntName) 'Prints True
    vntName = ""
    Debug.Print IsEmpty(vntName) 'Prints False
    vntName = Empty
    Debug.Print IsEmpty(vntName) 'Prints True
End Sub

 








Related examples in the same category

1.Using the ISEMPTY Function to Check Whether a Cell Is Empty
2.Working with Empty and Null