Here are two functions, each taking a different approach, to determine workdays (Mon - Fri).
Function CalcWkDays(dteStartDate As Date, dteEndDate As Date) As Integer
'input: (from debug window) ? CalcWkDays(#01/01/01#, #07/01/01#)
'output: 129
Dim X As Integer
X = DateDiff("d", dteStartDate, dteEndDate) _
- 2 * DateDiff("ww", dteStartDate, dteEndDate) _
+ IIf(WeekDay([dteStartDate]) = 7, 1, 0)
CalcWkDays = X
End Function
Function CalcWkDays2(dteStartDate As Date, dteEndDate As Date) As Integer
'input: (from debug window) ? CalcWkDays2(#01/01/01#, #07/01/01#)
'output: 130
'NOTE:As written,this counts both start and end dates.
Dim n As Integer
n = 0
Do While dteStartDate <= dteEndDate
'17 in the following expression represents the numeric
'days of week for Sunday(1) and Saturday (7)
n = n + IIf(InStr("17", WeekDay(dteStartDate)) = 0, 1, 0)
dteStartDate = dteStartDate + 1
Loop
CalcWkDays2 = n
End Function