IsEmpty function

Category: Array / Information

Summary

True if variable uninitialized.

Syntax

IsEmpty(expression) The required expression argument is a Variant containing a numeric or string expression. However, because IsEmpty is used to determine if individual variables are initialized, the expression argument is most often a single variable name.

Example

Example
This example uses the IsEmpty function to determine whether a variable has been initialized.
Dim MyVar, MyCheck
MyCheck = IsEmpty(MyVar) ' Returns True.

MyVar = Null ' Assign Null.
MyCheck = IsEmpty(MyVar) ' Returns False.

MyVar = Empty ' Assign Empty.
MyCheck = IsEmpty(MyVar) ' Returns True.

Microsoft Support Page

https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/isempty-function

Back to Functions