This is a slick algorithm that will save your company money. I will describe the algorithm while I walk you through the code. But before that I would like to set the inputs and assumptions in this algorithm.
I.Customer Order

II.No of Molds Available for the day.

III. No of stations that can be mounted with molds: 12
IV. Time to make any pair of shoe by a mold = 20 minutes (this does not matter that much but would be helpful).
V. A mold can operate continuously without breakdown to make the shoes during a shift.
VI. Algroithm Description: All the orders of different shoe sizes are sorted from the highest demand to the lowest demand. All the stations get one each of each mold making its shoe. Thus the 8 stations will get one of 8 molds. The other 4 stations will be mounted with additional mold of the first four shoes of highest demand. As and when a shoe of size of lesser number to be made is done, it Is replaced with a mold of next higher order. For example, when shoe size 40 (whose demand is 30) is finished that particular station should be mounted with the next mold 41 ( No of Changeover = 1). Now the mold size 40 is already making shoe size of 40 now it gets additional output from the additional mold changed over to the station where 40 had just been completed. Similarly, when shoe size 41’ order is finished, now you have additional two stations that become ready to take the mold size 36. There is only one station according to our initial distribution which may be making shoe size 36. These are called operating number of molds (OPNOM in the code). Now you check if these two stations could take additional molds of 36. In our example 36 has 5 molds available. So the additional stations which became clear could be mounted with 2 more 36 size mold (No of changeovers = 2). Now the OPNOM according to our initial distribution is only one because 36 is the third from the lowest of customer demand. After adding these two additional 36 molds you now have the regular OPNOM making shoes of size 36 along the with two additional molds making shoes of size 36. Now after the full order of 70 is made, you have available 3 stations clear. The next higher shoe size is 39. OPNOM for this is 1 leaving space for two more. Now only two stations are mounted with 39 (No of Changeovers = 2). One station sits idle. When shoes of size 39 demand is finished, you move to the next shoe size of higher demand which is 42. Now four stations become clear to be mounted with additional molds of size 42. But the number of molds of size 42 available is only 2 of which all 2 are OPNOM (4 in the order of demand size). So at this point all four stations sit idle ( there are no change overs). After 42 is completed, the next mold of higher demand is 35. Now 6 stations become clear to receive additional molds. OPNOM for this is 2 and number of additional molds available is one. Only 1 station of of the six is mounted with mold size 35 ( No of Changeover = 1). After 35 is made, the next higher demand shoe size is 37. Now you have 8 stations that are set clear to receive molds. The OPNOM for 37 is two, available is 1, thus one more additional 37 mold is mounted on one of those 8 stations(No of Changeovers = 1). After 37 is completed, you have 10 stations that are set clear. The last shoe size is 38. OPNOM for this is 2, available is 4 leaving two extra molds that could be mounted at the two of the 10 free stations(No of Changeovers = 2). Finally 38 is completed and the whole customer order is done. If you add up all the no of changeovers, you get a minimum Changeovers of 9.

This algorithm could be tweaked with initial distribution of OPNOM. I tried but it did not improve the results if you had “No of Changeovers” is the critierion that you will have to minimize. You could improve the algorithm by the actual schedule when and what needs to be changedover and the total time of processing and idle time of stations. These are statistics that could help you further enhance the algrorithm to your liking.
I have written a EXCEL MACRO to achieve the desired result. Hopefully this algorithm is useful to you and your company.
The code for the same is
Option Explicit
Dim Demand(1 To 8) As Double
Dim NOM(1 To 8) As Double
Dim OPNOM(1 To 8) As Double
Dim TOM As Double
Dim i, j, k, l As Integer
Dim Temp As Double
Dim temp1 As Double
Dim Changeover As Double
Dim Process1 As Double
Dim Process As Double
Private Sub cmdCalculate_Click()
'***Read values
Demand(1) = ComputeFV.D_35.Value
Demand(2) = ComputeFV.D_36.Value
Demand(3) = ComputeFV.D_37.Value
Demand(4) = ComputeFV.D_38.Value
Demand(5) = ComputeFV.D_39.Value
Demand(6) = ComputeFV.D_40.Value
Demand(7) = ComputeFV.D_41.Value
Demand(8) = ComputeFV.D_42.Value
NOM(1) = ComputeFV.MOLD35.Value
NOM(2) = ComputeFV.MOLD36.Value
NOM(3) = ComputeFV.MOLD37.Value
NOM(4) = ComputeFV.MOLD38.Value
NOM(5) = ComputeFV.MOLD39.Value
NOM(6) = ComputeFV.MOLD40.Value
NOM(7) = ComputeFV.MOLD41.Value
NOM(8) = ComputeFV.MOLD42.Value
TOM = ComputeFV.TOC.Value
'*** Sort Demand
For i = 1 To 7
For j = i To 8
If (Demand(i) <= Demand(j)) Then
Temp = Demand(i)
temp1 = NOM(i)
Demand(i) = Demand(j)
NOM(i) = NOM(j)
Demand(j) = Temp
NOM(j) = temp1
End If
Next
Next
'***.Intial Distribution of Molds to the Stations. OPNOM is begining
operating mold and NOM is the
'*** is the remaining available molds of any size.
For i = 1 To 8
OPNOM(i) = 1
NOM(i) = NOM(i) - 1
Next
For i = 9 To 12
If NOM(i - 8) > 0 Then
OPNOM(i - 8) = OPNOM(i - 8) + 1
NOM(i - 8) = NOM(i - 8) - 1
End If
Next
'*** Process is the amount of demand made by the initial setup. and Process1
is the amount of demand of any shoe size made
*** by additinal changeovers.
Changeover = 0
k = 0
j = 0
For i = 8 To 1 Step -1
Process = 0
Process1 = 0
10 For l = 1 To OPNOM(i)
Process = TOM + Process
Next
GoTo 40
20 For l = 1 To k
Process1 = TOM + Process1
Next
If Process1 + Process > Demand(i) * TOM Then
GoTo 50
40 If Process > Demand(i) * TOM Then
GoTo 30
Else:
GoTo 20
End If
50 j = j + k
GoTo 30
Else:
GoTo 10
30 End If
If i = 1 Then
GoTo 70
Else:
If (OPNOM(i) = 2) Then
k = k + 2
Else:
k = k + 1
End If
If (k > NOM(i - 1)) Then
k = NOM(i - 1)
Else: k = k
End If
End If
Next i
70 Changeover = j
ComputeFV.No_of_Changeovers.Value = Changeover
End Sub
Private Sub cmdClose_Click()
Unload ComputeFV
End Sub
Private Sub TextBox10_Change()
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, _
CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox "Please use the button!"
End If
End Sub