Results 1 to 4 of 4

Thread: Convert Schedules to Interval Staffing
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Jan 2018
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Convert Schedules to Interval Staffing

    Hey,

    i want to convert a schedule into interval staffing with VBA. How to start this project?

    1. Read the data into a array.
    2. Calculate each shift duration.
    3. ????


    Please help me with some guidelines. I dont expect to receive here the full code but at least information what I need to google in the web.

    Thanks in advance


  2. #2
    Board Regular tyija1995's Avatar
    Join Date
    Feb 2019
    Posts
    648
    Post Thanks / Like
    Mentioned
    14 Post(s)
    Tagged
    4 Thread(s)

    Default Re: Convert Schedules to Interval Staffing

    Hey,

    Given the setup above the cells N7:T21 will be outputted with the given code:

    Code:
    Sub OutputTime()
        Dim i As Integer, j As Integer
            For i = 7 To 21
                For j = 14 To 20
                    Cells(i, j).Formula = "=IFERROR(SUMPRODUCT((TIMEVALUE(LEFT(" & _
                    Split((Columns(j - 10).Address(, 0)), ":")(0) & "$7:" & _
                    Split((Columns(j - 10).Address(, 0)), ":")(0) & "$19,4))<=VALUE($M" & i & "))*(TIMEVALUE(RIGHT(" & _
                    Split((Columns(j - 10).Address(, 0)), ":")(0) & "$7:" & _
                    Split((Columns(j - 10).Address(, 0)), ":")(0) & "$19,5))>=VALUE($M" & i & "))),0)"
                Next j
            Next i
    End Sub
    √-1 2³ ∑ π
    …And it was delicious!

  3. #3
    New Member
    Join Date
    Sep 2019
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Convert Schedules to Interval Staffing

    I wish to make this happen too using Google Sheets. This time, the source will be coming from a different sheet in the same file. What's going to be the formula?

  4. #4
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    51,042
    Post Thanks / Like
    Mentioned
    57 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Convert Schedules to Interval Staffing

    I wish to make this happen too using Google Sheets. This time, the source will be coming from a different sheet in the same file. What's going to be the formula?
    Welcome to the Board!

    Google Sheets is an entirely different beast than Excel, and there is no guarantee that those involved in this thread know how to do it in Google Sheets (or if they have even ever used Google Sheets before!).

    I recommend you start a new thread on the topic, and post it to the "General Excel Discussion & Other Questions" forum (https://www.mrexcel.com/forum/genera...her-questions/), and be sure to make it very clear that you are looking for a Google Sheets solution. You can post a link back to this thread in your question, if you feel that may be helpful to people.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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