+ Reply to Thread
Results 1 to 2 of 2

Excel SUMMATION macro

  1. #1
    Registered User
    Join Date
    Toronto CANADA
    MS-Off Ver
    Excel 2003

    Excel SUMMATION macro

    Hi All,

    Trying to build an excel VBA macro but just getting my feet wet with the tool.

    So far I have this:

    Sub Loop_Until()

    x = 17
    Do Until Cells(x, 7) = 200
    ActiveCell.FormulaR1C1 = ""

    The purpose of this Macro is to loop until the combinations of either summing or not summing a string of numbers equals the value 200.

    I used Randomization because I could not think of a complex matrix structure that would solve this more efficiently, so I'm going the brute force route.

    Any ideas because as the string of variables get longer the time it takes to solve gets exponentially longer?

    Thanks in advance for your help!

  2. #2
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013

    Re: Excel SUMMATION macro

    Without seeing your workbook, it's going to be really difficult to help you. Also, you should be sure to put any code you post within Code tags. Some of what your current code is doing doesn't make sense to me. I'm guesing the following code does the same thing without selecting J16 or changing the formula of the active cell(J16) in each loop.
    Please Login or Register  to view this content.
    -Greg If this is helpful, pls click Star icon in lower left corner

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1