IsMissing Function

Syntax

IsMissing(expr)

Group

Variable Info

Description

Return the True if Optional parameter expr does not have a default value and it did not get a value. An Optional parameter may be omitted in the Sub, Function or Property call.

Parameters

Parameters Description
expr Return True if this variant parameter's argument expression was 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