Hi All,
I'm nearing the end of creating a staff schedule template that will allow users to create a bi-monthly staff scheduling workbook that is broken down into a separate worksheet for each week within a two month period. I have created a user form that is called when the 'Schedule Master Template' (attached) is opened. The user form has two combo boxes - one to select a year for the schedule and the second to select the pair of months the schedule is for - and a command button to run the macro that creates the workbook.
It is the macro that creates the schedule from the user form command button click that I need assistance with. I'll try to describe the requirements below.
Userform ComboBox1 selections are: Please Select, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026
Userform ComboBox2 selections are: Please Select, January/February, March/April, May/June, July/August, September/October, November/December
Userform CommandButton1 is to create the schedule.
Using the selections for year and month pairings in the two combo boxes as references, I am hoping to populate cell E2 on sheet 3 with the first Monday of the month and cells H2, K2, N2, T2 and W2 with the next six consecutive days. For example, (as per the TEST attachment) for selections 2015 and March/April, E2 will be 2nd March (first Monday of the month) in the format MONDAY 02 MAR or Monday 02 Mar, and and cells H2, K2, N2, T2 and W2 will be populated with the next 6 days. The sheet should then be named with the first and last day on the sheet + the month. Format for this sheet first sheet should show '02-08Mar'.
The macro should then create further sheets for the next number of weeks until the last week containing the last Monday of the second month has been reached, naming each day within each worksheet at E2, H2, K2, N2, T2 and W2 and naming the sheet as it progresses.
The 'TEST - 02_Schedule_Mar_Apr_2015' attachment has what the finished schedule would look like. Please ignore errors within the workbook as this is a work in progress and could also be due to me removing sensitive data.
The biggest hurdle I have is having the macro recognise the first and last Monday of a two month set when creating new worksheets. If someone could assist with code to create the necessary worksheets from the userform data selections, I could probably sort out the naming of the days and worksheets myself.
Any help would be greatly appreciated!
Regards,
Bookmarks