+ Reply to Thread
Results 1 to 6 of 6

Solver Loop stops obeying constraints

  1. #1
    Registered User
    Join Date
    08-02-2017
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2010
    Posts
    20

    Solver Loop stops obeying constraints

    Hi all, I've posted about this VBA before, but issues keep popping up so I gotsta return

    The loop works most of the time, but sometimes the loop stops adhering to the constraints. This happens at random times in the loop and sometimes doesn't happen, but it appears to be that it stops changing either the D or C value for a certain point on the loop. Sometimes it starts working at the next point, and sometimes it continues to fail. I know its not because the constraints can't be met because if I fiddle around with the values in C and D before running the loop it produces the right answers.

    Any ideas regarding how to guarantee that the loop runs correctly the whole way through first time?

    Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: Solver Loop stops obeying constraints

    Hi, cannot tell with the information provided.
    How about attaching a sample file? non-sensitive data please
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    08-02-2017
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2010
    Posts
    20

    Re: Solver Loop stops obeying constraints

    What exactly would you need? There is quite a lot of information which I don't imagine would be necessary. Thanks

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Solver Loop stops obeying constraints

    Please Login or Register  to view this content.
    Not sure as I can't test using my tab pro but could you try to change this line to
    Please Login or Register  to view this content.
    Alf

  5. #5
    Registered User
    Join Date
    08-02-2017
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2010
    Posts
    20

    Re: Solver Loop stops obeying constraints

    Thanks. For some runs that seems to have reduced error. For others the macro appears to iterate for the first value in the loop (wrongly and ignoring all of the constraints) and these C and D values are copied down for the rest of the loop

  6. #6
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Solver Loop stops obeying constraints

    Then I think you better do as Keebelah suggested and download a file. As you said that the original file contains more information than needed perhaps you can make a file containing only the solver model and the data needed for the solver run.

    As I'm on vacation this week with no PC only my tab pro I can't be of any further help but that should not be any problem as there are a number of forum members with excellent solver and mathematical know-how who can solve your problem.

    Alf

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Excel Solver VBA - Solver Violating Constraints
    By lespaul00 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-19-2015, 04:00 PM
  2. solver (LP) constraints
    By tsatsos007 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-08-2014, 04:40 PM
  3. Solver constraints help
    By Rogeo in forum Excel General
    Replies: 0
    Last Post: 01-11-2014, 04:56 PM
  4. Using solver with constraints
    By Hadoushi in forum Excel General
    Replies: 4
    Last Post: 03-15-2013, 08:17 PM
  5. How to use Solver constraints : dif
    By alee001 in forum Excel General
    Replies: 0
    Last Post: 06-06-2012, 02:36 PM
  6. Solver constraints shall be OR // Solver target cell
    By Cunner in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2009, 04:28 AM
  7. Solver Constraints
    By Rick in forum Excel General
    Replies: 15
    Last Post: 03-09-2005, 01:06 PM

Tags for this Thread

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