+ Reply to Thread
Results 1 to 4 of 4

Help with writing VBA code to loop Solver

  1. #1
    Registered User
    Join Date
    08-06-2012
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    7

    Question Help with writing VBA code to loop Solver

    Hi all,

    I'm relatively new to Excel VBA and using add-ins, but I've been trying to use solver to iterate multiple variables with a number of constraints until a satisfactory outcome is reached (see attached screenshot). ScreenHunter_02 Aug. 06 11.33.gif

    While I can get the code to work for a single cell in row 298, I need to be able to copy the solver code down to each subsequent row ending at row 426. Since running solver manually takes too much time, could someone please show me how to write the proper VBA code? Any help would be greatly appreciated.

    Thanks,

    Yegor

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Help with writing VBA code to loop Solver

    Maybe, if you post a workbook instead of a picture, and explain in context.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    08-06-2012
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Help with writing VBA code to loop Solver

    Quote Originally Posted by shg View Post
    Maybe, if you post a workbook instead of a picture, and explain in context.
    I took a stab at writing the code myself. The code runs to completion, but none of the values below line 298 are updating. What am I doing wrong?

    Please Login or Register  to view this content.
    Last edited by Cutter; 08-06-2012 at 07:56 PM. Reason: Added code tags

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Help with writing VBA code to loop Solver

    I think all that is equivalent to ...

    Please Login or Register  to view this content.
    What version of Excel are you using? It's not Excel 2003 as shown in your profile.

    I have no suggestion without seeing the workbook.

    ---------- Post added at 05:11 PM ---------- Previous post was at 05:06 PM ----------

    Maybe what you want is closer to this:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

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