IsEmpty (function)

Syntax

IsEmpty(expression)

Description

Returns True if expression is a Variant variable that has never been initialized; returns False otherwise.

Comments

The IsEmpty function is the same as the following:

 (VarType(expression) = ebEmpty)

Example

Sub Main()
  Dim a As Variant
  If IsEmpty(a) Then
    a = 1.0#   'Give uninitialized data a Double value 0.0.
    MsgBox "The variable has been initialized to: " & a
  Else
    MsgBox "The variable was already initialized!"
  End If
End Sub

See Also

Variant (data type); IsDate (function); IsError (function); IsObject (function); VarType (function); IsNull (function).

More information

I