View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default Work book with working days only

here's one way. It will put all week days of the current month in column A.

Sub test()
Dim dtStart As Date
Dim dtEnd As Date
Dim dt As Date
Dim l As Long

dtStart = DateAdd("d", -Day(Date) + 1, Date)
dtEnd = DateAdd("m", 1, dtStart) - 1

dt = dtStart
l = 1
While dt <= dtEnd
If Application.WorksheetFunction.Weekday(dt, 2) < 6 Then
ActiveSheet.Range("A" & l).Value = dt
l = l + 1
End If
dt = dt + 1
Wend

End Sub


--
Hope that helps.

Vergel Adriano


"Thyag" wrote:

Hi All,

I Need the code that can generate sheets with date of all the working
days in a month.

Note - Working days are the days between monday and friday.

Thanks
Thyag