Hi Barb!
Maybe this website is better for a download:
http://www.file-upload.net/download-2040953/dynamic-target-stock.xls.html
Well, here is the problem description:
Initial Stock (B5) and Demand (C9:F9) for 4 months are given. The Demand
can be satisfied by the use of stocks above the target and by production
Calculations:
Usable Stocks:
There exists an initial Stock (B5) (->last month) and a preassigned
target-stock by hand (Sheet 2, C4:F4)
If the final stock of the previous month is greater than the target-stock,
the difference (C10:F10) can be used to satisfy a part of the demand
Demand minus Usable stock is the required production (C11:F11).
Production:
IF the required production is less than the production-capacity (C12:F12),
the required production is fully produced in Prod. Iteration (J12:M12)
If the initial stock or the final stock of the previous month is below its
target-stock, the difference is shown as a delta stock (J13:M13). If the
capacity is still sufficient, this delta additionally should be produced to
refill stocks
The required production plus an eventual delta stock is actual production
(C14:F14), which can't exceed capacity
Shortage:
If the capacity is not sufficient to produce the required production (here:
January) then there is a shortage (C17:F17)
Stock:
Actual Stock of next month = Stock of the previous month - demand +
production + shortage
Problem:
Stocks above the target-stock are used to satisfy demand, stocks below the
target should be refilled by additional production
You can see that in January there exists a shortage because there is no free
production-capacity. You can also see that there is free capacity in the
previous months (C15:F15).
The shortage appears because I can't produce in January and I also cannot
use stocks to satisfy demand
Solution:
At the moment I would higher the target-stock in December or November by
hand. This ensures higher production to refill stocks which I can use in
January
But I am searching for a macro which calcualtes the target stocks
automatically
How to do that with VBA?
Restrictions:
The target Stock has a minimum -> the min-stock (Sheet2, B5:F5)
If there is a shortage in January, the production in december should produce
as much of this shortage as it can
If the production in december cannot produce that much because of the
capacity the production in november should produce the rest of the shortage
in january...and so on
Idea:
Target Stock of previous month = Min Stock + sum of alle shortages in future
Long description. Hope you can understand it.