Results 1 to 6 of 6

Completely new to VBA, need help on setting up a solver loop

Threaded View

  1. #1
    Registered User
    Join Date
    01-23-2017
    Location
    England
    MS-Off Ver
    2016
    Posts
    3

    Completely new to VBA, need help on setting up a solver loop

    I need help on how to set up a loop that solves a column of objective cells vs a column of variable cells.

    It doesn't matter that type of solver it is, "GRG Nonlinear" seems to work fine.

    My objective cells are E7:E207
    Where the solution is minimized or =0 because I want a real root.

    My variable cells are D7:D207

    The variables that it is solving are a cubic equation where it outputs the real root (no imaginary parts). I've looked around the forum but I can't really seem to make much sense. Any help would be much appreciated!

    I've made a basic macro so far
    Sub Solver()
    '
    ' Solver Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+S
    '
        Range("E8").Select
        SolverOk SetCell:="$E$7", MaxMinVal:=3, ValueOf:=0, ByChange:="$D$7", Engine:=1 _
            , EngineDesc:="GRG Nonlinear"
        SolverOk SetCell:="$E$7", MaxMinVal:=3, ValueOf:=0, ByChange:="$D$7", Engine:=1 _
            , EngineDesc:="GRG Nonlinear"
        SolverSolve
    End Sub
    tsumannai
    Last edited by tsumannai; 01-23-2017 at 12:13 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Setting the solver properly
    By altaris in forum Excel General
    Replies: 3
    Last Post: 06-28-2016, 01:38 PM
  2. Solver VBA Loop
    By excelnoobie164 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-13-2014, 12:15 PM
  3. Solver Help: Setting a Constraint to Allow Two Values
    By Schooch47 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-23-2014, 09:05 PM
  4. Loop Solver with VBA
    By cloudwalking in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-20-2014, 03:04 PM
  5. Using solver with loop
    By mat1973 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2013, 02:01 PM
  6. Setting up Solver constraint
    By Jstewart304 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-23-2012, 01:36 PM
  7. Setting Solver Reference-programmatically
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-01-2006, 08:15 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