Hiya,
I'm building a roster for my business and to save time, I'm attempting to automate it. this is due to multiple rosters rebuilds taking place throughout the rostered period & I would rather not copy and paste names hundreds of times.
The Roster on Sheet "Roster" looks like this:
I have a multi dim array that fills from a table of active staff. Each staff member has their own unique "line" attached to them. So for example, the array looks like this:
Item One
Joe Bloggs
1
Item Two
Anita Formula
2
Item Three
Chris Swanson
3
The Array has the employee's name in position 1 and their line/rotation number is position 2.
the roster is not in a table format, it's just a range. This is due to it essentially being a template to be uploaded to a different system and requires it to just be a regular range & won't work if it's in a table. Meaning I have to find the range by getting last row. so depending on the length of the current roster, it could be A1:D400 or A1:D100.
I essentially need something that loops through the range and fills the final col (this case will be D) with the emplyee name where the line number in col A is the number in position 2 of the array. So, the above would come out looking like this:
I've shortened the example above but the array I currently have has 32 staff in (so 32-line numbers). For some extra info, this can change each time I have to roll a new roster through. So I've already set everything up so far to be dynamically sized. f that makes a difference.
Any help is massively appreciated.
I'm building a roster for my business and to save time, I'm attempting to automate it. this is due to multiple rosters rebuilds taking place throughout the rostered period & I would rather not copy and paste names hundreds of times.
The Roster on Sheet "Roster" looks like this:
Line/Rotation Number | Date | Employee |
1 | 01/03/2023 | |
1 | 02/03/2023 | |
1 | 03/03/2023 | |
2 | 04/03/2023 | |
2 | 05/03/2023 | |
2 | 06/03/2023 | |
3 | 07/03/2023 | |
3 | 08/03/2023 | |
3 | 09/03/2023 |
I have a multi dim array that fills from a table of active staff. Each staff member has their own unique "line" attached to them. So for example, the array looks like this:
Item One
Joe Bloggs
1
Item Two
Anita Formula
2
Item Three
Chris Swanson
3
The Array has the employee's name in position 1 and their line/rotation number is position 2.
the roster is not in a table format, it's just a range. This is due to it essentially being a template to be uploaded to a different system and requires it to just be a regular range & won't work if it's in a table. Meaning I have to find the range by getting last row. so depending on the length of the current roster, it could be A1:D400 or A1:D100.
I essentially need something that loops through the range and fills the final col (this case will be D) with the emplyee name where the line number in col A is the number in position 2 of the array. So, the above would come out looking like this:
Line Number | Date | Employee |
1 | 01/03/2023 | Joe Bloggs |
1 | 02/03/2023 | Joe Bloggs |
1 | 03/03/2023 | Joe Bloggs |
2 | 04/03/2023 | Anita Formula |
2 | 05/03/2023 | Anita Formula |
2 | 06/03/2023 | Anita Formula |
3 | 07/03/2023 | Chris Swanson |
3 | 08/03/2023 | Chris Swanson |
3 | 09/03/2023 | Chris Swanson |
I've shortened the example above but the array I currently have has 32 staff in (so 32-line numbers). For some extra info, this can change each time I have to roll a new roster through. So I've already set everything up so far to be dynamically sized. f that makes a difference.
Any help is massively appreciated.