View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Anthony D Anthony D is offline
external usenet poster
 
Posts: 78
Default Distribute Lengths without loss

(re-post, hopefully format better)

required supplied available total
36 36 9 15 27 32 40 123

2 2 -2 -2
3 3 -3 -3
5 5 -5 -5
10 10 -10 -10
16 16 -16 -16
etc

remaining 4 0 11 32 40 87


"John Cole, Jr." wrote:

Thanks for the help, but I'm never going to be able to do what is
necessary. What about a shortcut. Let's say Column "A" has the
lengths I need while Column "B" has the Lengths available. Is there a
way I can run a macro to take the longest length in A, assign it to
longest in B, therefore shrinking that pipes length. Then take the
second is column A and assign it to the next longest and so on. When
part of a length is used, it should be placed back in the selection
group with the length previously taken subtracted from it. This would
be some form of a loop.

JC