Calculate date and days.

  • Thread starter Thread starter Floyd Forbes
  • Start date Start date
F

Floyd Forbes

Is there to a way to calculate the numbers of day in a month and exclude
Sundays.

Floyd
 
you could paste in this function:

Function NoSundays(FromDate As Date, ToDate As Date)
'NoSundays returns the number of workdays (excl Sun) between
''FromDate & 'ToDate' inclusive

FromDate = FromDate - 1
Do
FromDate = FromDate + 1
If WeekDay(FromDate) > 1 Then NoSundays = NoSundays + 1
Loop Until FromDate = ToDate
End Function
call it via:

NoSundays([FromDate],[ToDate])
 
Back
Top