IsMissing Function

The ISMISSING function is used to test whether an argument is present or not.
This function can only be used with parameters that are declared as variant.
These variant datatypes can then be converted to other data types using the data type conversion functions.
This function can be used to test for optional parameters.
When using the ISMISSING function the variable must always be declared as variant.
This function does not work on simple data types (like Integer, String, Date) but does work on Variant.

Public Sub Procedure_One() 
   Call Procedure_Two("Times New Roman", 20)
End Sub

Public Sub Procedure_Two(Optional ByVal sFontName As String = "Arial", _
                         Optional ByVal vFontSize As Variant)

   If Not IsMissing(vFontSize) = True Then
   End If
End Sub


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext