View Single Post
  #8   Report Post  
Randy
 
Posts: n/a
Default

Bernie I do have one more question about the solution you gave me
below. What would I have to change to have it give me a date before
the weekend and/or holiday rather than after. Some of the tasks
require action before the weekend and/or holiday.

DueDate(A1,10,J2:J30)


HTH,
Bernie
MS Excel MVP


Function DueDate(OutDate As Date, _
DaysOut As Integer, _
Holidays As Range)
Dim myRet As Variant
Dim DayIncreased As Boolean


DueDate =3D OutDate + DaysOut
TestDate:
DayIncreased =3D False
While Weekday(DueDate, vbMonday) 5
DueDate =3D DueDate + 1
DayIncreased =3D True
Wend


myRet =3D Application.Match(CLng(CDate(D=ADueDate)), Holidays, False)


While Not IsError(myRet)
DueDate =3D DueDate + 1
DayIncreased =3D True
myRet =3D Application.Match(CLng(CDate(D=ADueDate)), Holidays, False)
Wend=20


If DayIncreased Then GoTo TestDate:=20


End Function