Automatically create shift schedule in Excel - YouTube

Channel: Barb Henderson

[0]
so it's always asking me the other day whether I could automate entering shifts
[4]
for employees into a work schedule now this isn't exactly what he had in mind
[9]
but it gave me some ideas on doing this so what we have is we have 10 employees
[13]
working at this corporation and they receipt they work five days straight and
[21]
get two days off consecutively and so what I've done is I've created something
[27]
so that it will put in five days on and two days off for every employee and and
[33]
once again they they have ten employees but they have they need they need six so
[41]
on the bottom this is my same shift schedule that I've showed you how to
[45]
create before so this is for the month of May and they need six people working
[51]
at every time every day so let's run this the days off are indicated with an
[63]
O and conditionally formatted so if they're older green so that they stand
[69]
out a little bit and so there you have the complete shift shift schedule for
[74]
them and you can see the number of people working and the all of these are
[79]
over six so when it says negative two that means that they have two people
[86]
extra there now so let's undo this so let's just delete this shift schedule
[92]
and then this is what I'm thinking would be an advantage to be able to run this
[96]
so let's say employee number one wanted vacation days 11th 12th 13th so let's
[105]
enter a vacation and I've color-coded or conditionally formatted that so it turns
[112]
yellow and so that's so we've entered the vacation now let's run the I've set
[120]
up a I've set up a box a button to run my schedule here and I'm just not going
[126]
off and running it so so let's run this again and then you see
[133]
that when you run you run a schedule with the vacation in there on on the
[140]
fifth your I'm sorry on the 11th you have a problem there's only going to be
[146]
five and so you're gonna be short one but on the twelfth and thirteenth it's
[152]
going to be no problem so maybe you could talk this person into possibly
[157]
taking their vacation the twelve thirteenth and fourteenth and that way
[161]
you would have no problem so let's change this to an X and let's change
[167]
this to a V so if this person we were able to change his vacation of the 12th
[176]
13th and 14th this would allow your schedule to work
[179]
perfectly because there's no days that you're short of anything here so let me
[184]
show you the code so basically what I used is I used the offset function so I
[194]
figured out the first the first row I equals four equals the fourth row is
[201]
where the employee goes and so I say range I 3 and I 4 is off and then the
[210]
next five days so I shifted I shifted by 7 and then I
[216]
put the other the next two days off and I keep going shifting by 7 and doing
[222]
those all the way down now I do a lot of copying and pasting on this little bit
[228]
of code here so I copied the whole works from I equals 4 2 equals 5 and now what
[236]
I have done is I've shifted that over by one for the FIR I've offset it by one
[240]
for the first row and then I've added offset to instead of 7 14 21 I have 8 15
[251]
22 and 29 to figure it figure out the rest of them so I've done that for all
[257]
of the 10 rows and then what I've done is I've gone through the range from c4
[265]
which is for two AG 13 which is c4 here to AG 13
[272]
and then I have I have said range C for Ag 13 dot replace what and I have what
[282]
is as nothing and if there's nothing there replace it with an X for working
[286]
so that is how you enter a schedule for your employees automatically I will
[295]
include this VBA code in my description please subscribe