Description
Returns a value indicating whether an optional argument has been passed to a procedure.
Syntax
IsMissing(argname)
The argname named argument is the name of an optional procedure argument.
Remarks
The IsMissing function is used in a procedure that has optional arguments, including ParamArray arguments, to determine whether an argument has been passed to the procedure. IsMissing returns True if no value has been passed for the specified argument; otherwise, it returns False.
See Also
Function Statement, IsArray Function, IsDate Function, IsEmpty Function, IsError Function, IsNull Function, IsNumeric Function, IsObject Function, Property Get Statement, Property Let Statement, Property Set Statement, Sub Statement, TypeName Function, Variant Data Type, VarType Function.
Example
This example uses the IsMissing function to check if an optional argument has been passed to a user-defined procedure.
' The following statements call the user-defined function procedure. ReturnValue = ReturnTwice() ' Returns Null. ReturnValue = ReturnTwice(2) ' Returns 4. ' Function procedure definition. Function ReturnTwice(Optional A) If IsMissing(A) Then ' If argument is missing, return a Null. ReturnTwice = Null Else ' If argument is present, return twice the value. ReturnTwice = A * 2 End If End Function