阅读背景:

VBA to extract values from a list until the sum is within a certain range

来源:互联网 

I have a list of values and I need to pull values from this list until the sum is somwhere between 1,200,000 and 1,300,000. I originally sorted the list from smallest to largest then did End(xlUp) and just began removing values from the bottom of the list until the sum was less that 1,300,000 but the issue i had was that the last number i was extracting was fairly large so the sum would be significantly below 1,200,000. What would be best is if I can write som VB code that will look at my list, pull values until the sum is less than 1,300,000 and then will only pull the next value if it is 100,000 or less... if the next value is greater than 100,000 just skip and look at next one. I have a list of values and I need to pull valu




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: