Hi,
Attached, you can find a workbook that contains a button on the first tab. The button generates monthly sheet tables containing names of people (short names or "shorts") that are randomly filtered from a main table.
Do you know how to adapt the VBA code in order to include the criteria below in the combined rows 4, 5 and 6 of each generated month sheet?
- Row 4: Shorts with two criteria "Full revision" and "Overwork" that are filtered from the table on the main table sheet. Per day, this short in row 4 has to be different from the shorts in rows 5 and 6. A short of row 4 can only be used once a week and maximum twice a month. Preferably, the line of VBA code defining the monthly maximum is customisable (i.e. easily editable to e.g. once a month).
- Rows 5 and 6: Shorts with two criteria "Translation" and "Overwork".
- Combined rows 4, 5 and 6: Per day, the shorts in rows 4, 5 and 6 have to be unique. For the combined rows 4, 5 and 6, there also cannot be similar shorts on an adjacent day in the same working week.
Example: a short of row 5 on Monday cannot be the same short of row 4 on Tuesday, but it could be the same short as row 6 on Friday of the previous week.
- Shorts of rows 4, 5 and 6 can be used maximum 4 times a month if the short works 76-100%, 3 times a month if 51-75%, and 2 times a month if 0-50% (for the exact percentages, see "full/part time" column of the table in the main table sheet). If a month has not been completely filled out in the rows 4, 5 or 6, all shorts must be maximized. Example: a 100% short cannot be only filled in 3 times a month, it should be filled in 4 times a month. This also means that no short can work less than twice a month, nor more than four times a month.
Bookmarks