- Home
·
- Math/Dates
·
- Calculate number of working days between two given dates
Calculate number of working days between two given dates
Calculate number of working days between two given dates
Rate Calculate number of working days between two given dates
(2(2 Vote))
''Calculates no of working days between two dates*****
''Use Two Date Pickers for two dates
''Label to display no of working days
Private Sub DTPicker1_Change()
DTPicker2_Change
End Sub
Private Sub DTPicker2_Change()
Dim c, dt,i,j
d1 = Format(DTPicker1.Value, "dd/mm/yyyy")
d2 = Format(DTPicker2.Value, "dd/mm/yyyy")
c = DateDiff("d", d1, d2)
For i = 1 To c + 1
dt = Format(d1, "dddd")
If dt <> "Sunday" Then
j = j + 1
End If
d1 = DateAdd("d", 1, d1)
Next
Label.Caption = j
End Sub
Calculate number of working days between two given dates Comments
No comments yet — be the first to post one!
Post a Comment