Consulting

Results 1 to 9 of 9

Thread: Sleeper: Staffing Roster Automation

  1. #1
    VBAX Contributor
    Joined
    Oct 2004
    Location
    Cardiff
    Posts
    120
    Location

    Sleeper: Staffing Roster Automation

    Hi

    I'm writing this on behalf of TWK who'll be registering shortly.

    What I have is a rather large number of work shift codes which indicate what weekend days a given staff member will be working over a four week period

    There is a list of employees on one sheet that has a code next to each employee, and what we?re hoping for is that a macro will look at the employee?s shift code and then assign him the appropriate series of shifts in the roster sheet.

    I have attached a copy of the w/book for you to see what the roster looks like. But the OP is happy to hear any suggestions on using an entirely different suggestion if it?ll be easier but still give him what he needs.

    Many thanks, and good luck TWK.

    Tamer
    You cannot solve all the world's major problems using only potatoes. :- Adams

    http://www.vbaexpress.com

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Master
    Joined
    Jan 2005
    Location
    Porto Alegre - RS - Brasil
    Posts
    1,219
    Location
    Hi Tammer,

    I didnt understand the logic, nor which one is the shift code (FTE, ROTATION, WEEKEND). Thought its WEEKEND but in this case I didnt understand its logic. Can you provide more info on this?
    Best Regards,

    Carlos Paleo.

    To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.

    If Debugging is harder than writing a program and your code is as good as you can possibly make
    it, then by definition you're not smart enough to debug it.




    http://www.mugrs.org

  3. #3
    Administrator
    VP-Knowledge Base VBAX Master
    Joined
    Jan 2005
    Location
    Porto Alegre - RS - Brasil
    Posts
    1,219
    Location
    Sorry, only now I have seem the Code Explanation sheet .

    What a goofed
    Best Regards,

    Carlos Paleo.

    To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.

    If Debugging is harder than writing a program and your code is as good as you can possibly make
    it, then by definition you're not smart enough to debug it.




    http://www.mugrs.org

  4. #4
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Don't feel bad Carlos, I had a look at both sheets and I still didn't understand, so I thought I'd leave it for someone that may.

    I would like to know more before I could even start...
    1) How long are the shifts? e.g. midnight to 8am, then 8am to 4pm, then 4pm to midnight, or, maybe 6 hour shifts?
    2) How many workers are required for each shift?
    3) If there are more available for a shift than the number of positions available, what criteria is to be used to assign the workers to the shift? (I assume that's part of the code given) e.g. Seniority? By rotation?
    Randomly?
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  5. #5
    Administrator
    VP-Knowledge Base VBAX Master
    Joined
    Jan 2005
    Location
    Porto Alegre - RS - Brasil
    Posts
    1,219
    Location
    Hi John,

    you right. We need some more info. I have started it but without knowing the answers for your questions is almost impossible to solve it. What I did so far (thats almost nothing) was:

    Private Sub cmdWeekend_Click()
        Sheets("Staff").Activate
        Dim Folga As String
        For i = 2 To Range("E65536").End(xlUp).Row
            Folga = Range("E" & i)
            If Mid(Folga, 1, 1) = "T" Then
    End If
        Next
    End Sub
    Best Regards,

    Carlos Paleo.

    To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.

    If Debugging is harder than writing a program and your code is as good as you can possibly make
    it, then by definition you're not smart enough to debug it.




    http://www.mugrs.org

  6. #6
    VBAX Contributor
    Joined
    Oct 2004
    Location
    Cardiff
    Posts
    120
    Location
    Both,

    Thanks for answering this for me (well, TKW really).

    I can answer one of your questions: How long are the shifts? Well, many of the employee codes have an A, B, E, or D after them and these indicate the shift times as per the info on "Code Explanations" on columns E & F

    As for the other questions. No idea.

    I'll get bring TWK's attention to your answers, and perhaps he can throw some light on this for you.

    Thanks

    Damo
    You cannot solve all the world's major problems using only potatoes. :- Adams

    http://www.vbaexpress.com

  7. #7
    Administrator
    VP-Knowledge Base VBAX Master
    Joined
    Jan 2005
    Location
    Porto Alegre - RS - Brasil
    Posts
    1,219
    Location
    Hi Damo,

    ok, thanks and lets get it solved to TKW or TWK (you used both).
    Best Regards,

    Carlos Paleo.

    To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.

    If Debugging is harder than writing a program and your code is as good as you can possibly make
    it, then by definition you're not smart enough to debug it.




    http://www.mugrs.org

  8. #8
    VBAX Contributor
    Joined
    Oct 2004
    Location
    Cardiff
    Posts
    120
    Location
    Sorry, it's TWK

    Thanks again. Sent him an email to check the site earlier, so he should get here soon I guess.
    You cannot solve all the world's major problems using only potatoes. :- Adams

    http://www.vbaexpress.com

  9. #9
    VBAX Newbie
    Joined
    Feb 2005
    Posts
    1
    Location
    Hi All. Thank You for Working on this. Sorry it took me awhile to post.
    First Let offer a little more exsplanation. What I'm hoping to do is to be able to assign the codes to people and have there names print out on the second sheet for each schedule. If then for example a person working every weekend(EW0) decides that they want to switch to every third weekend(ETW) then I can simply change their code and there name will print out on the schedule sheets accordingly. It would also be nice to have there names print out according to there shift. Days(7am-3pm)Evenings 1 (3p-7p)Evenings 2 (7p-11p) and Nights 11p-7a. Evenings is split since most people work 12hr shifts Their names would be on both shifts. For example someone working an "A" (7a-7p) would have there name under Days and Evenings 1. and the totals would show for each shift at the bottom. If this last part would be too much work I would be fine with just getting everyones names under the right dates. Hope this helps with some of your questions. The program won't be responsible for deciding what weekends are short or who needs to be assigned where. It strictly goes off the infor I put in for the weekend code.

Posting Permissions

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