Code:
Private Sub Command1_Click()
Dim EndDate, CurDate As Date
Dim BusDay, TotBusDays, CalcYear As Integer
TotBusDays = 1
CurDate = DTPicker1.Value
EndDate = DTPicker2.Value
Do Until CurDate = EndDate
BusDay = Format(CurDate, "w")
Select Case BusDay
Case "2" To "6"
TotBusDays = TotBusDays + 1
Case "1"
'Do nothing
Case "2"
'Do nothing
End Select
CurDate = DateAdd("d", 1, CurDate)
Loop
If Check1.Value = vbChecked Then
TotBusDays = TotBusDays - 1
End If
If Check2.Value = vbChecked Then
TotBusDays = TotBusDays - 1
End If
If Check3.Value = vbChecked Then
TotBusDays = TotBusDays - 1
End If
If Check4.Value = vbChecked Then
TotBusDays = TotBusDays - 1
End If
If Check5.Value = vbChecked Then
TotBusDays = TotBusDays - 1
End If
If Check6.Value = vbChecked Then
TotBusDays = TotBusDays - 1
End If
If Check7.Value = vbChecked Then
TotBusDays = TotBusDays - 1
End If
End Sub
Comment