Allocation with VBA until limit value is reached

JM_Man

New Member
Joined
Feb 19, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I'm scratching my head with a problem that seems to have a simple resolution but which I can't find; so I'm in need for your help.

In a warehouse, I have several Buffer Areas to store boxes that will be shipped to several Destinations (see green table).
Each Buffer Area has its own maximum capacity (see blue table), but can only store boxes for two Destinations at the most.

What I need is a VBA code to fill the last column ("Buffer Area"), in the green table, with the designated Buffer Area to store the boxes before they are shipped to the respective destinations - the order in which the Buffer Areas are given to the Destinations should be from the first row of the table to the last one.
Ideally the end result would be what is illustrated in the Orange table.

I would really appreciate any help.
Thanks!
 

Attachments

  • Destination.PNG
    Destination.PNG
    19.9 KB · Views: 7
  • Capacity.PNG
    Capacity.PNG
    15.9 KB · Views: 6
  • Allocation.PNG
    Allocation.PNG
    21.3 KB · Views: 6
Last edited by a moderator:

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Allocation with VBA until limit value is reached
and Allocation with VBA until limit value is reached
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,215,758
Messages
6,126,709
Members
449,331
Latest member
smckenzie2016

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