Sub CalculateLaodQty()
'Calculate maximume arton load on pallet
'only a few of these potential variables are used
Dim PalletWidth As Double
Dim PalletLength As Double
Dim PalletHeight As Double 'Maximum allowed
Dim PalletWeight As Double 'Maximum allowed
Dim CartonWidth As Double
Dim CartonLength As Double
Dim CartonHeight As Double
Dim CartonWeight As Double
Dim WidthQty As Double
Dim LengthQty As Double
'LayerBrick Patterons
Dim LengthToLengthLayerQty As Integer
Dim LengthToWidthLayerQty As Integer
Dim AlternateDirection As Boolean
Dim Basketweave As Double
Dim HalfBasketweave As Double
Dim Herringbone As Double
Dim JackOnJack As Double
Dim Length_RowWidthQty As Double
Dim Length_RowLengthQty As Double
Dim Width_RowWidthQty As Double
Dim Width_RowLengthQty As Double
'gather data
PalletWidth = Range("C2")
PalletLength = Range("C3")
PalletHeight = Range("C4")
PalletWeight = Range("C5")
CartonWidth = Range("C7")
CartonLength = Range("C8")
CartonHeight = Range("C9")
CartonWeight = Range("C10")
'Determine quantity for one row Length
Length_RowWidthQty = Application.WorksheetFunction.RoundDown(PalletWidth / CartonLength, 0)
Length_RowLengthQty = Application.WorksheetFunction.RoundDown(PalletLength / CartonLength, 0)
'Determine quantity for one row Width
Width_RowWidthQty = Application.WorksheetFunction.RoundDown(PalletWidth / CartonWidth, 0)
Width_RowLengthQty = Application.WorksheetFunction.RoundDown(PalletLength / CartonWidth, 0)
'Calculate layer quantity laid Length to Length
LengthToLengthLayerQty = Length_RowLengthQty * Width_RowWidthQty
'Calculate layer quantity laid Length to Width
LengthToWidthLayerQty = Length_RowWidthQty * Width_RowLengthQty
MsgBox "Layer Laid Length to Length QTY " & LengthToLengthLayerQty & vbLf & _
"Layer Laid Length to Width Qty " & LengthToWidthLayerQty
End Sub