Dim iDay As Long, i As Long, iWeekdays As Long Date1 = f(DTPicker2.value) Date2 = f(DTPicker6.value) ' loop through each date and check day For i = 0 To DateDiff("d", Date1, Date2) iDay = Weekday(Date1 + i, vbSaturday) If iDay < 6 Then ' not Saturday or Sunday iWeekdays = iWeekdays + 1 End If Next i Text3.Text = iWeekdays
If iDay < 6 Then
If iDay <> 6 Then
For aDay = Date1 To Date2 If WeekDay(aDay) <> 6 Then iDays = iDays + 1 End If Next aDay
aDay
Date
iDays
Integer
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)