Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? Public Function RecissionDate(CheckDate, DaysAfter As Integer, Holidays As Range) As Date Dim BDADate As Date Dim i As Integer If isSunday(CheckDate) Or isHoliday(CheckDate, Holidays) Then BDADate = "" Else BDADate = CheckDate For i = 1 To DaysAfter BDADate = BDADate + 1 If isSunday(BDADate) Or isHoliday(BDADate, Holidays) Then BDADate = BDADate + 1 Else: BDADate = BDADate End If If isSunday(BDADate) Or isHoliday(BDADate, Holidays) Then BDADate = BDADate + 1 Else: BDADate = BDADate End If Next i End If SunTrustRecissionDate = BDADate End Function |
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 |