VBA generate schedule help!

fisiggy

New Member
Joined
Mar 25, 2023
Messages
3
Office Version
  1. 2019
Platform
  1. Windows
Looking to write a macro that will generate a 12 week schedule that pairs and area with a person when the same elements are selected.

Would like it to handle up to 200 people and 200 areas - it will vary though, sometimes there will be 50 areas and 20 people or any combination.

Currently I have it set up to turn areas on with "1" and off with "0"

Every area should have one visit scheduled per week, cycling through consistently so if element 1 is the only element turned on they will have 12 visits, if element 1, 2, & 3 are on the visits will repeat in that order. I was going to build it to generate the areas schedule first then pair it with a person who can work on that element.

Each person might be on a weekly visit rotation or monthly (Will be validated text to select this). No person should have to visit an area twice in one week unless there is a constraint for people.


1679774127843.png


On a separate sheet in the same workbook this is what I was thinking for the output

1679774566237.png


Looking for advice on where to start or what the code should be. I am a beginner coder and not sure how to handle so many dependencies, thanks in advance for any help!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
The green and red off are conditional formats based on "1" and "0"
Not sure if that was clear in my original post.
 
Upvote 0
I have something in mind ...

May the Area and Person tables be in different worksheets?
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top