+ Reply to Thread
Results 1 to 5 of 5

Parameter Relationship with VBA Solver Loop

  1. #1
    Registered User
    Join Date
    10-30-2014
    Location
    Atlanta
    MS-Off Ver
    2013
    Posts
    11

    Parameter Relationship with VBA Solver Loop

    Parameter Relationship.xlsx

    In the above workbook I need to build out a loop that will work solver through the calculation for all 197 rows. The variables n (column D) and m (column E) would change in solver so that the Formula in column F (which includes these variables) equals the formula in column C (which has the same other variables, Mass and Term, but not m and n).

    If anybody has any suggestions on how this can be done quickly and efficiently that would be great.

    Thanks

    M

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

    Re: Parameter Relationship with VBA Solver Loop

    equation: a*(n-1)+b*(m-1)=a*b --> a*(n-1)+b*(m-1)-a*b=0

    with 1 equation in 2 unkowns, there will not be a single unique solution. for example, I get n=1.776 and m=1.707 for row 4.

    I would probably solve this kind of problem algebraically first. Dust off your algebra skills and solve for n as a function of m (or m as a function of n). Then, you will be able to choose a reasonable value for m and compute the corresponding n. Such a formula could easily be copied down as far as needed. No need for Solver at all.

    If there are other criteria that need to be considered to narrow down the possible solutions, then you can take those into account in your choice of m.
    Last edited by MrShorty; 03-02-2015 at 03:54 PM.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    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,794

    Re: Parameter Relationship with VBA Solver Loop

    Perhaps like this? To test run macro "SolvLoop"

    Before you run the macro you must set a reference to solver in Visual Basic.

    Developers tab -> Visual Basic -> Tools -> References and tick box "Solver"

    Alf
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-30-2014
    Location
    Atlanta
    MS-Off Ver
    2013
    Posts
    11

    Re: Parameter Relationship with VBA Solver Loop

    Hi Alf...thanks very much...M

  5. #5
    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,794

    Re: Parameter Relationship with VBA Solver Loop

    You are welcome.

    And if this solves your problem don't forget to mark your thread "Solved"

    Alf

    Ps
    To mark your thread solved do the following:
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

+ 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] Solver For Loop
    By Hayashi151 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-16-2014, 05:32 PM
  2. Error in Text to columns loop due to parameter
    By icyrius in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-11-2013, 06:17 AM
  3. VBA Loop with Solver.
    By ec41tp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-17-2011, 11:23 AM
  4. Parameter Convergence with Solver
    By PDK in forum Excel General
    Replies: 0
    Last Post: 07-22-2009, 11:18 AM
  5. Solver parameter constraint question
    By Morrigan in forum Excel General
    Replies: 7
    Last Post: 06-08-2005, 11:05 AM

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