In your point of view your code works fine but it does not give correct result, if you copy my result sheet data and paste it in the front of your code result data , then you will be able to find difference, let me explain you through an example if a range start number 100101 to end range number 100105 qty = 5 and i say to distribute this range in three diferent IDs , like ID A , to give 2, ID B to 1, and ID C to 2 then above range is distributed like this
IDs Start range End range Qty
a 100101 100102 2
b 100103 100103 1
c 100104 100105 2
It is difficult but can be coded and resolved as given result in my result sheet.
In your code result is like
IDs Start range End range Qty
a 100101 100105 2
b 100101 100105 1
c 100101 100105 2




Reply With Quote
Bookmarks