Hi JimmiOO
Here is a possible macro alternative, which may be usable
Sub PalletCalculation()
Dim nRow As Integer: Dim nCol As Integer
Dim wsStock As Worksheet
Set wsStock = Worksheets("STOCK")
For nRow = 5 To wsStock.UsedRange.Rows.Count Step 3 'starting from 5th row
For nCol = 10 To wsStock.UsedRange.Columns.Count Step 3 'starting from 10th column
Order = wsStock.Cells(nRow, nCol)
Pallet = wsStock.Cells(nRow, 5)
If Pallet = 0 Then Exit For
If Order = 0 Then
CumPallet = CumPallet + Round(PrevOrder / Pallet, 2)
Exit For
Else
PrevOrder = Order
End If
Next nCol
Next nRow
Range("B3").Value = CumPallet
End Sub
Bookmarks