Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Dec 27, 12:29*pm, atpgroups wrote:
On 27 Dec, 17:03, John Pierce wrote: The following UDF works perfectly - except for the first line, i.e. when CheckDate is a Sunday or Holiday. The result is #VALUE! but I want just a blank or empty cell. How can I suppress or fix this? The problem is that you have defined the function to return a Date, and "" isn't a valid date. (The date datatype is a specialised numeric type) If you change the "...) *As Date" to "...) As Variant" it should work. Also note that an "If" doesn't need an "Else", and your "Else"s seem to do nothing. Thanks, changing 'as Date' to 'as Variant' in both places fixed it. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error when cell A1 is not active and xlInsideVertical border formatthrowing error 1004 | Excel Programming | |||
Error handling error # 1004 Run-time error | Excel Programming | |||
Error Handling - On Error GoTo doesn't trap error successfully | Excel Programming | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming | |||
Automation Error, Unknown Error. Error value - 440 | Excel Programming |