-
Tony...I've seen the following from another board, but I can't quite see how to post the holidays:
[VBA] Function NetWorkDays(Start_Date As Date, End_Date As Date, Holidays() As =
Variant) As Integer
Dim intX As Integer
Dim intCount As Integer
Dim intUbound As Integer
Dim tempEnd_Date As Date
intX =3D DateDiff("d", Start_Date, End_Date)
intCount =3D 0
Do Until intCount =3D intX
Select Case WeekDay(DateAdd("d", intCount, Start_Date))
Case vbSaturday, vbSunday
intX =3D intX - 1
End Select
intCount =3D intCount + 1
Loop
tempEnd_Date =3D DateAdd("d", intCount, Start_Date)
For intX =3D LBound(Holidays) To UBound(Holidays)
If Holidays(intX) >=3D Start_Date And Holidays(intX) <=3D =
tempEnd_Date Then
intCount =3D intCount - 1
End If
Next
NetWorkDays =3D intCount
End Function
[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules