Results 1 to 7 of 7

Create worksheets for weeks between and including first and last Mon of two month period

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    138

    Create worksheets for weeks between and including first and last Mon of two month period

    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,
    Attached Files Attached Files
    Dave C

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 10
    Last Post: 01-09-2014, 07:04 PM
  2. Get maximum frequency in 9 weeks rolling period
    By baltblue in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-15-2013, 11:37 AM
  3. Replies: 0
    Last Post: 07-30-2013, 09:01 AM
  4. Count number of networkdays for each month in a multi month period
    By dreddster in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-10-2013, 11:12 AM
  5. [SOLVED] Need help with a formula to divide allotted hours over a period of weeks.
    By Irishmatty513 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-01-2013, 07:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1