Return to VBA Code Examples

VBA IsMissing Function

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on July 19, 2021

IsMissing Description

Used to check if an optional argument to a procedure is missing.

Simple IsMissing Examples

Sub MyProcedure(Optional param)
    If IsMissing(param) Then
        MsgBox "Param is missing"
        MsgBox "Param is not missing"
    End If
End Sub

For the procedure above, test the following codes.

Call MyProcedure

Result: “Param is missing”

Call MyProcedure("abc")

Result: “Param is not missing”

IsMissing Syntax

In the VBA Editor, you can type¬† “IsMissing(” to see the syntax for the IsMissing Function:

The IsMissing function contains an argument:

VarName: the name of an optional variant procedure argument.

VBA Coding Made Easy

Stop searching for VBA code online. Learn more about AutoMacro - A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users! vba save as

Learn More!

VBA Code Examples Add-in

Easily access all of the code examples found on our site.

Simply navigate to the menu, click, and the code will be inserted directly into your module. .xlam add-in.

(No installation required!)

Free Download

Return to VBA Code Examples