Hello,
I'm trying to work assignments based off of requests for work. i have some VBA Experience, but everything I've tried is falling to pieces, and i wanted to see if i could get some help.
I gathered all time off requests for a timeframe (April 1 - Sept 30) in a forms and exported it to a worksheet. so it's : Name, 1st choice start, 1st choice end, BLANK, 2nd choice start, 2nd end, etc all the way to 5th choice.
On the list worksheet. i have dates listed vertically from April 1 all the way to sept 30. what i have been trying to do, is have VBA check the date in list (example: 04/01/2022) and compare it to the date ranges in all the requests on master. If a person requested time off for that day (say 04/01/-04/07) then i want it to list their last name, first name, id # (on master, G: ID # ,H: last name, I: First name) in one cell on the list worksheet row with the date. Then the next person, then the next, so that i end up with a horizontal list of every person who requested to be off on that particular day.
Examples are below. I have tried implementing multiple different codes from the forums, and none of them are getting me anywhere, so I'm absolutely up to starting from scratch.
End goal, is to have 5 buttons on the list page. 1 for each choice. 1st choice populates in 1 color, i compare the number of personnel authorized to be off that day to how many requested. If there's room for more people, press second choice, and it populates more in a different color. continuing horizontally.
I'm trying to figure this out in the macro recorder, but if anyone could help, i would truly appreciate it.
I'm trying to work assignments based off of requests for work. i have some VBA Experience, but everything I've tried is falling to pieces, and i wanted to see if i could get some help.
I gathered all time off requests for a timeframe (April 1 - Sept 30) in a forms and exported it to a worksheet. so it's : Name, 1st choice start, 1st choice end, BLANK, 2nd choice start, 2nd end, etc all the way to 5th choice.
On the list worksheet. i have dates listed vertically from April 1 all the way to sept 30. what i have been trying to do, is have VBA check the date in list (example: 04/01/2022) and compare it to the date ranges in all the requests on master. If a person requested time off for that day (say 04/01/-04/07) then i want it to list their last name, first name, id # (on master, G: ID # ,H: last name, I: First name) in one cell on the list worksheet row with the date. Then the next person, then the next, so that i end up with a horizontal list of every person who requested to be off on that particular day.
Examples are below. I have tried implementing multiple different codes from the forums, and none of them are getting me anywhere, so I'm absolutely up to starting from scratch.
End goal, is to have 5 buttons on the list page. 1 for each choice. 1st choice populates in 1 color, i compare the number of personnel authorized to be off that day to how many requested. If there's room for more people, press second choice, and it populates more in a different color. continuing horizontally.
I'm trying to figure this out in the macro recorder, but if anyone could help, i would truly appreciate it.
Mini Sheet Example-No PII.xlsm | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | |||
1 | ID # | Last Name: | First Name: | 1st Choice Vacation Beginning Date: | 1st Choice Vacation End Date: | 2nd Choice Vacation Beginning Date: | 2nd Choice Vacation End Date: | 3rd Choice Vacation Beginning Date: | 3rd Choice Vacation End Date: | 4th Choice Vacation Beginning Date: | 4th Choice Vacation End Date: | 5th Choice Vacation Beginning Date: | 5th Choice Vacation End Date: | ||
2 | 1 | SMITH | JOHN | 4/17/2022 | 5/1/2022 | 7/17/2022 | 7/24/2022 | 6/19/2022 | 6/26/2022 | 7/3/2022 | 7/10/2022 | 9/4/2022 | 9/11/2022 | ||
3 | 2 | JACKSON | MICHAEL | 7/2/2022 | 7/8/2022 | 5/25/2022 | 6/1/2022 | 4/13/2022 | 4/20/2022 | 9/1/2022 | 9/7/2022 | 6/15/2022 | 6/22/2022 | ||
4 | 3 | JOHNSON | PAUL | 4/22/2022 | 5/2/2022 | 4/1/2022 | 4/11/2022 | 7/24/2022 | 8/1/2022 | 6/10/2022 | 6/17/2022 | 9/16/2022 | 9/23/2022 | ||
5 | 4 | POWERS | AUSTIN | 7/11/2022 | 7/18/2022 | 9/19/2022 | 9/26/2022 | 7/18/2022 | 7/25/2022 | ||||||
6 | 5 | DIGGLER | DIRK | 4/13/2022 | 4/19/2022 | 6/21/2022 | 7/6/2022 | 7/12/2022 | 7/26/2022 | 8/7/2022 | 8/14/2022 | 9/7/2022 | 9/14/2022 | ||
7 | |||||||||||||||
8 | |||||||||||||||
9 | |||||||||||||||
10 | |||||||||||||||
11 | |||||||||||||||
12 | |||||||||||||||
13 | |||||||||||||||
14 | |||||||||||||||
15 | |||||||||||||||
16 | |||||||||||||||
17 | |||||||||||||||
MASTER |
Mini Sheet Example-No PII.xlsm | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | |||||||||||
2 | People Off: | Total Personnel: (337) 50.55 Is 15% | DATE | FIRST CHOICE (WILL BE A BUTTON) | SECOND CHOICE (WILL BE A BUTTON) | THIRD CHOICE (WILL BE A BUTTON) | FOURTH CHOICE (WILL BE A BUTTON) | FIFTH CHOICE (WILL BE A BUTTON) | |||
3 | 2 | 4.0% | 4/1/2022 | Smith, John ID1 | Johnson, Paul, ID 3 | ||||||
4 | 4/2/2022 | Johnson, Paul, ID 3 | Diggler, Dirk ID5 | Powers, Austin ID 4 | |||||||
5 | 4/3/2022 | Jackson, Michael ID 4 | |||||||||
6 | 4/4/2022 | ||||||||||
7 | 4/5/2022 | Johnson, Paul, ID 3 | Diggler, Dirk ID5 | Powers, Austin ID 4 | Smith, John ID1 | ||||||
8 | 4/6/2022 | Jackson, Michael ID 4 | Johnson, Paul, ID 3 | Diggler, Dirk ID5 | Powers, Austin ID 4 | ||||||
9 | 4/7/2022 | ||||||||||
10 | 4/8/2022 | ||||||||||
11 | 4/9/2022 | ||||||||||
12 | 4/10/2022 | ||||||||||
13 | 4/11/2022 | ||||||||||
14 | 4/12/2022 | ||||||||||
15 | 4/13/2022 | ||||||||||
16 | 4/14/2022 | ||||||||||
17 | 4/15/2022 | ||||||||||
18 | 4/16/2022 | ||||||||||
19 | 4/17/2022 | ||||||||||
20 | 4/18/2022 | ||||||||||
List |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B2 | B2 | =" Total Personnel: (337) " & 15%*(337) & " Is 15%" |
A3 | A3 | =SUMPRODUCT((D3:AS3<>"")*1) |
B3 | B3 | =A3/50.55 |
Mini Sheet Example-No PII.xlsm | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | |||
1 | ID | NAME | 1st | END | Granted | 2nd | End | Granted | 3rd | End | Granted | 4th | End | Granted | 5th | End | Granted | |||||||
2 | 1/1/1900 | SMITH | JOHN | 4/17/2022 | 5/1/2022 | YES | 7/17/2022 | 7/24/2022 | YES | 6/19/2022 | 6/26/2022 | NO | 7/3/2022 | 7/10/2022 | 9/4/2022 | 9/11/2022 | ||||||||
3 | 1/2/1900 | JACKSON | MICHAEL | 7/2/2022 | 7/8/2022 | YES | 5/25/2022 | 6/1/2022 | NO | 4/13/2022 | 4/20/2022 | NO | 9/1/2022 | 9/7/2022 | 6/15/2022 | 6/22/2022 | ||||||||
4 | 1/3/1900 | JOHNSON | PAUL | 4/22/2022 | 5/2/2022 | YES | 4/1/2022 | 4/11/2022 | NO | 7/24/2022 | 8/1/2022 | NO | 6/10/2022 | 6/17/2022 | 9/16/2022 | 9/23/2022 | ||||||||
5 | 1/4/1900 | POWERS | AUSTIN | 7/11/2022 | 7/18/2022 | YES | 9/19/2022 | 9/26/2022 | YES | 7/18/2022 | 7/25/2022 | NO | ||||||||||||
6 | 1/5/1900 | DIGGLER | DIRK | 4/13/2022 | 4/19/2022 | YES | 6/21/2022 | 7/6/2022 | NO | 7/12/2022 | 7/26/2022 | NO | 8/7/2022 | 8/14/2022 | 9/7/2022 | 9/14/2022 | ||||||||
Results |