jhnnyboz
06-12-2012, 10:37 AM
So I am trying to find the number of work days in a month given that the month is a user inputted integer.
so this is what assigns the month
month = InputBox("Enter the month as an number (EX. If you want to enter for January then enter 1).", "Info", "99")
then i want to find the nubmer of work days from month/1/current year to the end of the month.
so i have
startdate = month / 1 / 12
enddate = WorksheetFunction.EoMonth(startdate, 0)
workdaysinmonth = Application.WorksheetFunction.NetworkDays(startdate, enddate)
but it thinks i am trying to divide the month by one and by 12 and never gives me a date.
its like i need something like
startdate = &month& #1/12#
but that is not recogized by vba.
please help
so this is what assigns the month
month = InputBox("Enter the month as an number (EX. If you want to enter for January then enter 1).", "Info", "99")
then i want to find the nubmer of work days from month/1/current year to the end of the month.
so i have
startdate = month / 1 / 12
enddate = WorksheetFunction.EoMonth(startdate, 0)
workdaysinmonth = Application.WorksheetFunction.NetworkDays(startdate, enddate)
but it thinks i am trying to divide the month by one and by 12 and never gives me a date.
its like i need something like
startdate = &month& #1/12#
but that is not recogized by vba.
please help