Function CountDays(Date1,Date2)
On Error Resume Next
Err.Clear
da1=Date1
da2=Date2
DT1=FormatDateTime(Date1,2)
DT2=FormatDateTime(Date2,2)
Dim countNum
countNum=DateDiff("d",DT1,DT2)
For i=da1 to da2
If weekday(i)=1 or weekday(i)=7 Then
countNum=countNum-1
End If
Next
CountDays=countNum
End Function
---------------------------------------------------------------
AUTHOR:testerZH
用途:菜鸟的个人学习记录,有不对的地方请指正!谢谢!
出处:http://www.cnblogs.com/testerZH/