+ Reply to Thread
Results 1 to 8 of 8

VBA to Autofill a work/task schedule

  1. #1
    Registered User
    Join Date
    04-26-2012
    Location
    Louisville, KY
    MS-Off Ver
    Excel 2007
    Posts
    7

    VBA to Autofill a work/task schedule

    I need to make a work schedule in a where different people are assigned tasks on different days of the week.


    I would like to get any ideas on a way I can make a VBA that automatically fills out the blank days on the schedule while meeting these rules.
    - Only people that can preform the job are assigned to it.
    - If possible, a person only does one job a day.
    - If possible, a good rotation where you must do all the jobs you are assigned to.
    - If possible, a good mix of jobs that require multiple people.
    (example Task #1 requires 2 people on M/W/F and 1 on Tu/Th try to mix so you get an even number of chores on that task, not always stuck on M/W/F or Tu/Th)
    - If possible, try to keep it even as possible in Area #2 & 3
    (these are Common Areas, others are Group Areas)

    Attached is the beginning spreadsheet. This is an idea of where I'm heading for the schedule to look like. But open to any and all ideas.
    Feel free to suggest options to make it easier. I did start with an idea of a task that takes multiple people to have multiple cells (see Task Schedule Test tab).
    I'm fine going back to that format if it makes it easier.
    You'll notice I did add a simple conditional format that the employee can type their name and it highlights what days and tasks they are assigned to.
    I will also add a count to each employee so I can see the split of work. That will be easy so I'm not concerned about that formula.

    I'm not sure where to begin with this so I wanted to get some input and tips on where I should start or if anyone has encountered something similar to this already written which I can modify.
    Can anyone help me?

    Thank you in advance,
    Steven
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: VBA to Autofill a work/task schedule

    those are pretty long requirements. can you shorten that any? maybe others here are reading?

  3. #3
    Registered User
    Join Date
    04-26-2012
    Location
    Louisville, KY
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: VBA to Autofill a work/task schedule

    I was able to find a code that got me almost there.
    It was a code that did rotate jobs and did a good job, but the downfall was that it did not allow me to assign jobs to a group of people.
    I'm still playing with the VBA code to see if I can get it there.
    I did think about writing a new code for each assignment, but then I would run into the problem of one person having multiple jobs/tasks on a given day and then a while before their next task.
    That's the area I'm struggling with.
    Any suggestions?

  4. #4
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: VBA to Autofill a work/task schedule

    Quote Originally Posted by StevenP138 View Post
    Any suggestions?
    yep. post the code that ""almost got you there"".

  5. #5
    Registered User
    Join Date
    04-26-2012
    Location
    Louisville, KY
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: VBA to Autofill a work/task schedule

    This it the code I found that I'm working on to get me what I'm trying to do.
    As you can see in the code, this is from a different workbook. I am trying to modify this to work for what I need.

    Thanks for the help!


    Please Login or Register  to view this content.
    Last edited by StevenP138; 11-09-2020 at 11:26 AM.

  6. #6
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: VBA to Autofill a work/task schedule

    put your code inside tags. it is unreadable otherwise. they look like this (without spaces):

    [ code ]

    [ /code ]

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    43,761

    Re: VBA to Autofill a work/task schedule

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  8. #8
    Registered User
    Join Date
    04-26-2012
    Location
    Louisville, KY
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: VBA to Autofill a work/task schedule

    Sorry about the error in posting the code.
    I think this is fixed now.

    Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to calculate task schedule based on 4-days work and 4-days OFF including weekends
    By qadeerume in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-28-2020, 12:19 AM
  2. [Task] Dependencies [In a Schedule]
    By wvtn in forum Excel General
    Replies: 3
    Last Post: 03-24-2019, 12:00 AM
  3. create daily schedule using master task schedule
    By DCO in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2012, 01:08 PM
  4. Spreadsheet to schedule a task
    By dannycelluk in forum Excel General
    Replies: 6
    Last Post: 04-06-2012, 05:01 AM
  5. Schedule task code
    By Sam.K in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-06-2008, 02:00 AM
  6. Figuring out Availability based upon work/task schedule
    By B. Baumgartner in forum Excel General
    Replies: 0
    Last Post: 05-03-2007, 10:58 AM
  7. Schedule task without Login
    By macroplay in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-22-2006, 09:05 AM

Tags for this Thread

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