Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have run across a problem with an optional variant.
Code Example: Function X (A As Range, Optional B As Variant = ?) As Variant If IsEmpty(B) Then MsgBox "B is Empty" If IsNull(B) Then MsgBox "B is Null" If IsError(B) Then MsgBox "B is Error" If the optional argument "B" is initialized to "Null" (i.e. Optional B As Variant = Null) then the message "B is Null" is displayed. However, if "B" is initialized to "Empty" (i.e. Optional B As Variant = Empty), the "IsEmpty" is false and the message "B is Error" is displayed. Does anyone know why the initialization of "B" to "Empty" results in an error? Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Argument not optional | Excel Programming | |||
Argument not optional Error 449! Need Help | Excel Programming | |||
Don't understand why I'm getting an argument not optional | Excel Programming | |||
Compile Error: Argument not optional | Excel Programming | |||
optional argument in a function | Excel Programming |