Empty (constant)

Description

Constant representing a variant of type 0.

Comments

The Empty value has special meaning indicating that a Variant is uninitialized.

When Empty is assigned to numbers, the value 0 is assigned. When Empty is assigned to a String, the string is assigned a zero-length string.

Example

Sub Main()
  Dim a As Variant
  a = Empty
  MsgBox "This string is" & a & "concatenated with Empty"
  MsgBox "5 + Empty = " & (5 + a)
End Sub

See Also

Null (constant); Variant (data type); VarType (function).

More information

E