Do While Not cce > numdays
cce = bbb + 7 * xxi
ccc = ccc + 2
xxi = xxi + 1
Loop
If ccc > 0 Then
ccc = ccc - 2
End If
工作日 = numdays - ccc作者: jicheng 时间: 2007-10-22 11:02
Function Work_Days(BegDate As Variant, EndDate As Variant) As Integer
'Ó÷¨: Work_Days(#2006-7-1#,#2006-7-31#)
Dim WholeWeeks As Variant
Dim DateCnt As Variant
Dim EndDays As Integer
BegDate = DateValue(BegDate)
EndDate = DateValue(EndDate)
WholeWeeks = DateDiff("w", BegDate, EndDate)
DateCnt = DateAdd("ww", WholeWeeks, BegDate)
EndDays = 0
Do While DateCnt < EndDate
If Format(DateCnt, "ddd") <> "Sun" And _
Format(DateCnt, "ddd") <> "Sat" Then
EndDays = EndDays + 1
End If
DateCnt = DateAdd("d", 1, DateCnt)
Loop
Work_Days = WholeWeeks * 5 + EndDays
End Function作者: saffier155 时间: 2007-10-22 13:05
多谢这位高手!~太感谢了.激动啊..终于成功了..偶都试了好多种方法了.还是你的最管用...