by theg (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 3rd September 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Function that counts the difference between two dates excluding one day in a week (for example sunday - non-working day)
Dim tmpDate As Date
DateDifference = 0
S = 0
tmpDate = vbFirstDate
Do
Select Case DateTime.Weekday(tmpDate)
Case vbExcludeDay 'Skip excluded day
Case Else
DateDifference = DateDifference + 1 'If not excluded day inc
End Select 'by one
tmpDate = tmpDate - 1
Loop Until tmpDate = vbSecondDate
End Function
No comments have been posted about Function that counts the difference between two dates excluding one day in a week (for example sund. Why not be the first to post a comment about Function that counts the difference between two dates excluding one day in a week (for example sund.