I use this function to calculate number of working days. It does not account for Holidays.
Code was posted for me as you're asking for it now.
Function Work_Days(PickedUp As Variant) As Integer
' Note that this function does not account for holidays.
Dim WholeWeeks As Variant
Dim DateCnt As Variant
Dim EndDays As Integer
PickedUp = DateValue(PickedUp)
Date() = DateValue(Date)
WholeWeeks = DateDiff("w", PickedUp, Date)
DateCnt = DateAdd("ww", WholeWeeks, PickedUp)
EndDays = 0
Do While DateCnt < Date
If Format(DateCnt, "ddd") <> "Sun" And _
Format(DateCnt, "ddd") <> "Sat" Then
EndDays = EndDays + 1
End If
DateCnt = DateAdd("d", 1, DateCnt)
Loop
Work_Days = WholeWeeks * 5 + EndDays
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.