Sub Fix Ups Class

FixUpVariantToSingleMandSub

"Fix Up Variant To Single Mandatory Subroutine" Convert numeric, date/time, numeric string, and date/time string Variant values to the Single data type. Assign the default value vDefault to the argument rArgument if conversion is not possible.

Signature (Visual Basic / VBA)

Public Sub FixUpVariantToSingleMandSub( _
      ByRef rArgument As Variant _
    , ByVal vDefault As Variant _
    )

Parameters

Parameter Description
rArgument The argument which is changed to a Single value, if possible. Subroutine assigns the default vDefault to rArgument if conversion was not possible, such as when the rArgument is out-of-range, missing, Null, an error, a pointer, or a non-numeric string.
vDefault The default value which is assigned to rArgument when conversion is not possible.

Notes & Version History

Note rArgument is a passed by reference, so the variable passed from the calling function will likely be modified.
Note The default value can be a data type other than Single as long as it is compatible with the variable passed via rArgument.