I have a table as attached file where I already created a macro to repeat the lines based on the (rounded up) value under column "No. of Carton". Now, I will need a macro to help to calculate the quantity with the last line of item get the balance quantity. The result should be as seen under column "Carton Qty".
For example, 1600pcs of oranges with 330pcs per carton means that there will be 5 cartons. 4 cartons will be 330pcs each with the last carton consists the leftover of 280pcs.
Here is my file for reference: http://speedy.sh/92zS7/Book1.xlsx
Thanks for your help. I tried the formula you have provided and it seems fine. However, I would to check with you if it is possible to get the "amt in last column" to be printed at the last row of each category of fruit instead of the first line in the category?