Thanks, it works...
But the details I actualy need to fill in Excel worksheet is as follows:
Start Date: 9 Nov 2007
End Date : 3 Dec 2007
1) Sundays on : dd-mm-yy , dd-mm-yy,........
2) Holidays on : ........
3) Total Working days : ?? (by considering Monday to saturday as working Days)
I am to too exposed to programing, so please provide me the simplest
way to get the results that I need.
Thanks in advance for your help.
*Nilay*
"Greg Wilson" wrote:
> Try:
>
> Sub Test()
> MsgBox GetWorkdays("9 Nov 2007", "3 Dec 2007")
> End Sub
>
> Function GetWorkdays(FirstDate As Date, LastDate As Date) As Integer
> Dim i As Integer, ii As Integer
> ii = 0
> For i = 0 To (LastDate - FirstDate)
> If Weekday(FirstDate + i) <> 1 Then ii = ii + 1
> Next
> GetWorkdays = ii
> End Function
>
> Regards,
> Greg
|