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!

Destination.PNG
Capacity.PNG
Allocation.PNG