# Dates of working days in a month

#### karthick.in

##### New Member
Is there anyway that I can populate the list of dates (only working days) in a month?

For example:
Cell A1 has the drop down list of all the months (Jan to Dec)
Cell A2 has the drop down of year (2011, 2012, 2013, ...)

If I select "Dec" in A1 and "2011" in A2, then column A3 should have the date of first working day in the month, B3 should have the date of next working day in the month, C3 should have the date next to it, etc...

In this case A3 = 01/12/2011; B3 = 02/12/2011; C3 = 05/12/2011 .... V3 = 30/12/2011

This should work for whatever month and year I select in A1 and A2.

The solution to do this would be much appreciated. Thanks!

Last edited:

-

#### trunten

##### Active Member
Assign this macro to a button and away you go
Code:
``````Sub a()
sd = DateValue("01 " & [A1] & " " & [A2])
cd = sd
i = 1
While Month(cd) = Month(sd)
If Weekday(cd, vbMonday) < 6 Then
Cells(3, i) = cd
i = i + 1
End If
cd = cd + 1
Wend
End Sub``````

Excel Workbook
ABCDEFG
1Dec2011
2
 Sheet1

#### GopherUK

##### Active Member
The formula is B2 is just to be dragged across columns (i.e. there are only teo unique formulas in the post - A2 and B2).

#### karthick.in

##### New Member
Assign this macro to a button and away you go
Code:
``````Sub a()
sd = DateValue("01 " & [A1] & " " & [A2])
cd = sd
i = 1
While Month(cd) = Month(sd)
If Weekday(cd, vbMonday) < 6 Then
Cells(3, i) = cd
i = i + 1
End If
cd = cd + 1
Wend
End Sub``````
Many Thanks!

1,082,050
Messages
5,362,899
Members
400,696
Latest member
Kclynn

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...