IsMissing Function
Syntax
IsMissing(expr)
Group
Description
Returns the True if Optional parameter expr does not have a default value and it does not return a value. An Optional parameter can be omitted in the Sub, Function, or Property call.
Parameters
| Parameters | Description |
|---|---|
| expr | Returns True if this variant parameter argument expression is not specified in the Sub, Function, or Property call. |
Example
Sub Main Opt 'IsMissing(A)=True Opt "Hi" 'IsMissing(A)=False Many 'No args Many 1,"Hello" 'A(0)=1 A(1)=Hello OptBye '"Bye" OptBye "No" '"No" End Sub Sub Opt(Optional A) Debug.Print "IsMissing(A)="; IsMissing(A) End Sub Sub Many(ParamArray A()) If LBound(A) > UBound(A) Then Debug.Print "No args" Else For I = LBound(A) To UBound(A) Debug.Print "A(" & I & ")=" & A(I) & " "; Next I Debug.Print End If End Sub Sub OptBye(Optional A As String = "Bye") Debug.Print A End Sub