Although my method is probably laughable, I think it produces the results you want:
**Please try this on a copy of your worksheet and test extensively before running it on your original sheet - Always save your work before running the macro**
First, I set up a "helper" sheet called "Sheet2". If you already have a Sheet2, it will have to be called something else, and the code will have to be fixed accordingly. The sheet looks like this, and will have to be set up exactly like this for the code to work:
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W |
---|
| | | | | | | | | | | | | | | | | | | | | | | |
Mary | | | | | | | | | | | | | | | | | | | | | | | |
John | | | | | | | | | | | | | | | | | | | | | | | |
Joseph | | | | | | | | | | | | | | | | | | | | | | | |
Marg | | | | | | | | | | | | | | | | | | | | | | | |
Jenny | | | | | | | | | | | | | | | | | | | | | | | |
Marie | | | | | | | | | | | | | | | | | | | | | | | |
Matt | | | | | | | | | | | | | | | | | | | | | | | |
Noah | | | | | | | | | | | | | | | | | | | | | | | |
Jim | | | | | | | | | | | | | | | | | | | | | | | |
Ben | | | | | | | | | | | | | | | | | | | | | | | |
Sally | | | | | | | | | | | | | | | | | | | | | | | |
Amy | | | | | | | | | | | | | | | | | | | | | | | |
Larry | | | | | | | | | | | | | | | | | | | | | | | |
Fred | | | | | | | | | | | | | | | | | | | | | | | |
Wendy | | | | | | | | | | | | | | | | | | | | | | | |
Mark | | | | | | | | | | | | | | | | | | | | | | | |
Mike | | | | | | | | | | | | | | | | | | | | | | | |
Doug | | | | | | | | | | | | | | | | | | | | | | | |
<tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]Staff[/TD]
[TD="align: center"]Monday[/TD]
[TD="align: center"]Tuesday[/TD]
[TD="align: center"]Wednesday[/TD]
[TD="align: center"]Thursday[/TD]
[TD="align: center"]Friday[/TD]
[TD="align: center"]Area 1[/TD]
[TD="align: center"]Area 2[/TD]
[TD="align: center"]Area 3[/TD]
[TD="align: center"]Area 4[/TD]
[TD="align: center"]Area 5[/TD]
[TD="align: center"]Area 6[/TD]
[TD="align: center"]Area 7[/TD]
[TD="align: center"]Area 8[/TD]
[TD="align: center"]Area 9[/TD]
[TD="align: center"]Area 10[/TD]
[TD="align: center"]Area 11[/TD]
[TD="align: center"]Area 12[/TD]
[TD="align: center"]Area 13[/TD]
[TD="align: center"]Area 14[/TD]
[TD="align: center"]Area 15[/TD]
[TD="align: center"]Area 16[/TD]
[TD="align: center"]Area 17[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]17[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]18[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]19[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
</tbody>
Column A lists all of the staff members. Row 1 lists conditions where staff members cannot work. Each condition should be filled in with an "X" in the appropriate cell.
Next, open your VBA editor by pressing Alt + F11 and paste the following code into a module:
(This is the laughable part - I'm sure someone else could have made this much cleaner
Near the very end of the code (starting with "For Z=2 to lastrow" and ending with "Next Z") ensures that everyone gets on the schedule at least once. This can be taken out if that isn't necessary. (But it helps make sure that Noah doesn't miss out on his day.
Lastly, I put the following formula in cell J3 (next to Mary's name):
Copy this down to the last staff member. This will tell you how many times they are on the schedule that week.
| A | B | C | D | E | F | G | H | I | J |
---|
| | | | | | | | | | |
| | | | | | | | | | |
Mary | | | | | | | | | | |
John | | | | | | | | | | |
Joseph | | | | | | | | | | |
Marg | | | | | | | | | | |
Jenny | | | | | | | | | | |
Marie | | | | | | | | | | |
Matt | | | | | | | | | | |
Noah | | | | | | | | | | |
Jim | | | | | | | | | | |
Ben | | | | | | | | | | |
Sally | | | | | | | | | | |
Amy | | | | | | | | | | |
Larry | | | | | | | | | | |
Fred | | | | | | | | | | |
Wendy | | | | | | | | | | |
Mark | | | | | | | | | | |
Mike | | | | | | | | | | |
Doug | | | | | | | | | | |
| | | | | | | | | | |
<tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]
[TD="align: center"]Duty Roster[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]2[/TD]
[TD="align: right"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFF66]#FFFF66[/URL] , align: center"]Monday[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFF66]#FFFF66[/URL] , align: center"]Tuesday[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFF66]#FFFF66[/URL] , align: center"]Wednesday[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFF66]#FFFF66[/URL] , align: center"]Thursday[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFF66]#FFFF66[/URL] , align: center"]Friday[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFF66]#FFFF66[/URL] , align: center"]Staff[/TD]
[TD="align: center"][/TD]
[TD="align: center"]3[/TD]
[TD="bgcolor: #E2EFD9"]Area 1[/TD]
[TD="bgcolor: #E2EFD9"]Joseph[/TD]
[TD="bgcolor: #E2EFD9"]Jim[/TD]
[TD="bgcolor: #E2EFD9"]Amy[/TD]
[TD="bgcolor: #E2EFD9"]Ben[/TD]
[TD="bgcolor: #E2EFD9"]Marg[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]4[/TD]
[TD="bgcolor: #E2EFD9"]Area 2[/TD]
[TD="bgcolor: #E2EFD9"]Marie[/TD]
[TD="bgcolor: #E2EFD9"]Matt[/TD]
[TD="bgcolor: #E2EFD9"]Sally[/TD]
[TD="bgcolor: #E2EFD9"]Larry[/TD]
[TD="bgcolor: #E2EFD9"]Jenny[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]5[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]6[/TD]
[TD="bgcolor: #FFF3CB"]Area 3[/TD]
[TD="bgcolor: #FFF3CB"]Matt[/TD]
[TD="bgcolor: #FFF3CB"]Joseph[/TD]
[TD="bgcolor: #FFF3CB"]Matt[/TD]
[TD="bgcolor: #FFF3CB"]Jim[/TD]
[TD="bgcolor: #FFF3CB"]Jim[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]7[/TD]
[TD="bgcolor: #FFF3CB"]Area 4[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=000000]#000000[/URL] , align: right"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=000000]#000000[/URL] , align: right"][/TD]
[TD="bgcolor: #FFF3CB"]Marg[/TD]
[TD="bgcolor: #FFF3CB"]Amy[/TD]
[TD="bgcolor: #FFF3CB"]Amy[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]8[/TD]
[TD="bgcolor: #FFF3CB"]Area 5[/TD]
[TD="bgcolor: #FFF3CB"]Marg[/TD]
[TD="bgcolor: #FFF3CB"]Larry[/TD]
[TD="bgcolor: #FFF3CB"]Marie[/TD]
[TD="bgcolor: #FFF3CB"]Fred[/TD]
[TD="bgcolor: #FFF3CB"]John[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]9[/TD]
[TD="bgcolor: #FFF3CB"]Area 6[/TD]
[TD="bgcolor: #FFF3CB"]Fred[/TD]
[TD="bgcolor: #FFF3CB"]Amy[/TD]
[TD="bgcolor: #FFF3CB"]Jim[/TD]
[TD="bgcolor: #FFF3CB"]Matt[/TD]
[TD="bgcolor: #FFF3CB"]Larry[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]10[/TD]
[TD="bgcolor: #FFF3CB"]Area 7[/TD]
[TD="bgcolor: #FFF3CB"]Ben[/TD]
[TD="bgcolor: #FFF3CB"]Fred[/TD]
[TD="bgcolor: #FFF3CB"]Larry[/TD]
[TD="bgcolor: #FFF3CB"]Mary[/TD]
[TD="bgcolor: #FFF3CB"]Fred[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]11[/TD]
[TD="bgcolor: #FFF3CB"]Area 8[/TD]
[TD="bgcolor: #FFF3CB"]Mary[/TD]
[TD="bgcolor: #FFF3CB"]Marg[/TD]
[TD="bgcolor: #FFF3CB"]Fred[/TD]
[TD="bgcolor: #FFF3CB"]Mark[/TD]
[TD="bgcolor: #FFF3CB"]Matt[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]12[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]13[/TD]
[TD="bgcolor: #DEEBF6"]Area 9[/TD]
[TD="bgcolor: #DEEBF6"]Larry[/TD]
[TD="bgcolor: #DEEBF6"]Sally[/TD]
[TD="bgcolor: #DEEBF6"]John[/TD]
[TD="bgcolor: #DEEBF6"]Jenny[/TD]
[TD="bgcolor: #DEEBF6"]Marie[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]14[/TD]
[TD="bgcolor: #DEEBF6"]Area 10[/TD]
[TD="bgcolor: #DEEBF6"]John[/TD]
[TD="bgcolor: #DEEBF6"]John[/TD]
[TD="bgcolor: #DEEBF6"]Joseph[/TD]
[TD="bgcolor: #DEEBF6"]Sally[/TD]
[TD="bgcolor: #DEEBF6"]Ben[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]15[/TD]
[TD="bgcolor: #DEEBF6"]Area 11[/TD]
[TD="bgcolor: #DEEBF6"]Jim[/TD]
[TD="bgcolor: #DEEBF6"]Marie[/TD]
[TD="bgcolor: #DEEBF6"]Mike[/TD]
[TD="bgcolor: #DEEBF6"]Marie[/TD]
[TD="bgcolor: #DEEBF6"]Mary[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]16[/TD]
[TD="bgcolor: #DEEBF6"]Area 12[/TD]
[TD="bgcolor: #DEEBF6"]Amy[/TD]
[TD="bgcolor: #DEEBF6"]Ben[/TD]
[TD="bgcolor: #DEEBF6"]Mary[/TD]
[TD="bgcolor: #DEEBF6"]John[/TD]
[TD="bgcolor: #DEEBF6"]Noah[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]17[/TD]
[TD="bgcolor: #DEEBF6"]Area 13[/TD]
[TD="bgcolor: #DEEBF6"]Mark[/TD]
[TD="bgcolor: #DEEBF6"]Mary[/TD]
[TD="bgcolor: #DEEBF6"]Ben[/TD]
[TD="bgcolor: #DEEBF6"]Marg[/TD]
[TD="bgcolor: #DEEBF6"]Sally[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]18[/TD]
[TD="bgcolor: #DEEBF6"]Area 14[/TD]
[TD="bgcolor: #DEEBF6"]Sally[/TD]
[TD="bgcolor: #DEEBF6"]Mike[/TD]
[TD="bgcolor: #DEEBF6"]Wendy[/TD]
[TD="bgcolor: #DEEBF6"]Joseph[/TD]
[TD="bgcolor: #DEEBF6"]Joseph[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]19[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]20[/TD]
[TD="bgcolor: #EDEDED"]Area 16[/TD]
[TD="bgcolor: #EDEDED"]Wendy[/TD]
[TD="bgcolor: #EDEDED"]Doug[/TD]
[TD="bgcolor: #EDEDED"]Mark[/TD]
[TD="bgcolor: #EDEDED"]Mike[/TD]
[TD="bgcolor: #EDEDED"]Wendy[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]21[/TD]
[TD="bgcolor: #EDEDED"]Area 17[/TD]
[TD="bgcolor: #EDEDED"]Mike[/TD]
[TD="bgcolor: #EDEDED"]Wendy[/TD]
[TD="bgcolor: #EDEDED"]Doug[/TD]
[TD="bgcolor: #EDEDED"]Wendy[/TD]
[TD="bgcolor: #EDEDED"]Mike[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
</tbody>
Adding areas or changing the set-up of Sheet1 will cause errors in the code. Adding staff members, and changing around their work schedule should be fine though.
This should be as random as it gets, but certain staff members will pop up more frequently in a certain area depending on their availability. I should also mention that because of the size of the code, it may take a while to complete depending on computer speed. It took anywhere from about 2 - 30 seconds for me.