Hello All,
I am looking for a macro which can calculate working days in a given month from start end date excluding weekend and company holidays
Thanks,
Monika
Hello All,
I am looking for a macro which can calculate working days in a given month from start end date excluding weekend and company holidays
Thanks,
Monika
Have a look at NETWORKDAYS function
If you are pleased with a member's answer then use the Star icon to rate it.
tried that but that is not helping me to get values. Hoildays are in another sheet.
This is my code.
Sub date_macro()
Dim StartDate As Date, EndDate As Date
Dim Mon As Long
Dim wd As Long
Mon = InputBox("Enter the month as an number (EX. If you want to enter for January then enter 1).", "Info", "99")
StartDate = DateSerial(2012, Mon, 1)
EndDate = DateSerial(Year(StartDate), Month(StartDate) + 1, 0)
wd = Application.WorksheetFunction.NetworkDays(StartDate, EndDate)
End Sub
Please, use CODE tags around your code
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks