Results 1 to 33 of 33

Macro with Solver loop

Threaded View

  1. #16
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,391

    Re: Macro with Solver loop

    Alf's code in post #3 shows how to set up the loop. If that Solver model works, then it seems like that code should also work.

    Do you or Alf know what happens when Solver is called from VBA and it encounters an error? I rarely if ever call Solver from VBA, and several of my Solver runs encountered the function's asymptote (#Div/0 error), and I wonder if that could cause Solver to exit without changing anything.

    I would be curious to know if any of your solutions resulted in AP other than 5. My limited tests (without knowing typical values for AE or AI) all come to the solution where AP=5.

    If it helps, I uploaded the simple spreadsheet I used to analyze this problem. The two algebraic solutions (assuming I did the algebra correctly) are given in rows 34 and 35 (I would expect that row 35 will always be the minimum solution). I note that the solutions obtained using the Solver model (row 40) are all the same as those in row 35, and the resulting values for AP are all 5. I included a chart that shows the basic shape of AP as a function of AJ (calculated in rows 4:27).
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Solver - macro loop - want it faster
    By fidocze in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2016, 11:42 AM
  2. VBA Macro for Solver Loop
    By vizbasic in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-24-2016, 09:13 AM
  3. [SOLVED] Solver Loop Macro Question
    By ngiesbrecht in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2015, 05:25 PM
  4. Macro Loop for Solver
    By kchm_2000 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-28-2010, 09:42 AM
  5. Macro Loop for Solver
    By kchm_2000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-27-2010, 12:26 PM
  6. Macro to loop solver
    By NMason in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-25-2010, 03:19 PM
  7. Solver macro with Loop
    By golfclubs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-31-2010, 10:35 AM

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