How do I use DateDif

  • Thread starter Thread starter Barbara
  • Start date Start date
Not a straightforward way of doing this. But this function (found in another
newsgroup) may get you started for doing what
you seek:

Public Function NumberOfWeekDays(datStart As Date, datEnd As Date) As Long
Dim lngNumber As Long, lngTotalDays As Long, lngCount As Long
lngTotalDays = datEnd - datStart
lngNumber = 0
For lngCount = 1 To lngTotalDays
If DatePart("w", datStart + lngCount, vbMonday) < 6 Then lngNumber =
lngNumber + 1
Next lngCount
NumberOfWeekDays = lngNumber
End Function
 
Back
Top