VBA Module to run work allocation

twinkle99

Board Regular
Joined
Aug 7, 2005
Messages
240
I have a spreadsheet (Sheet1) which contains a breakdown of worktypes.

I have another Spreadsheet (Sheet2) which contains a breakdown of Staff.

Sheet1 is linked to a database table and updates every morning.

The total number of work items have to be allocated equally between the staff on a daily basis. At present, the work is allocated manually by completing Sheet2 with the appropriate do and check columns under each worktype until each member of staff has approximately 7 hours worth of work.

I would like to automate the completion of Sheet2 using VBA Programming. This can be done randomly. I am not really sure where to start with this but have a couple of ideas which could be incorporated into the module:

1. A tick box which allows the user to select the staff members available for Doing work.
2. A tick box which allows the user to select the staff members available for Checking work.

These tick boxes could eliminate any staff who are either sick, on holiday or on other jobs.

Important:
1. All work has to be checked by a different staff member to the doer.
2. The Module should complete do and check numbers for each worktype under Columns C to T (Sheet2) for each Staff Member (rows 6 to 15).
3. The total allocated work time for each staff member (column U) should be as close to 7 hrs as possible for each staff.
4. For simplicity, the module should assume that staff can do and check all types of work.
5. If there is more work than staff available, the Module should return the surplus work time (over 7 hrs) allocated to each staff member (Column V)
6. If there is less work than staff available, the Module should return the deficit work time not allocated (under 7 hrs) to each staff member (Column W)

Many Thanks

staff.xls
BCDEFG
3worktypenoofitemsunittimeunittimetotaltimetototaltimeto
4todo(min)tocheck(min)dowork(min)checkwork(min)
5Returns2615.0020.00390520
6Notices210.0010.002020
7Leavers050.0025.0000
8Calls285.0010.00140280
9Deliveries2100.0035.0020070
10Copies020.0020.0000
11Stamps1610.0015.00160240
12Contributions1250.0030.00600360
13Training450.0040.00200160
14total90310.00205.0017101650
Sheet1


staff.xls
BCDEFGHIJKLMNOPQRSTUVW
3
4ReturnsNoticesLeaversCallsDeliveriesCopiesStampsContributionsTrainingTotalallocatedSurplusWorkDeficitWork
5DoCheckDoCheckDoCheckDoCheckDoCheckDoCheckDoCheckDoCheckDoCheckworktimeAllocation(>7hrs)Allocation(<7hrs)
6Steve
7Terry
8Leo
9Patricia
10Carly
11Angela
12Rory
13Helen
14Charles
15Fiona
16
17total
Sheet2
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I could be wrong but this is not something for which you will get a free solution. This class of problems is fairly complex to solve.

You may want to look at Solver (an add-in bundled with Excel). It is designed to work with these kinds of problems. The downside is that except for really simple problems, Solver is not as easy to 'program' as creating any ole Excel model and applying Solver to it.
 
Upvote 0
Thanks Tusharm

I wasn't expecting a full solution to this, just really need some guidance on a) whether it would be possible and b) how I could start this.

Thanks
 
Upvote 0

Forum statistics

Threads
1,225,122
Messages
6,182,983
Members
453,143
Latest member
boatrunner

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