+ Reply to Thread
Results 1 to 2 of 2

Solver VBA Loop Basic

  1. #1
    Registered User
    Join Date
    04-24-2018
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    1

    Solver VBA Loop Basic

    Hi, I am trying to get a loop VBA run for a very simple formula. Essentially I have data from B15:Z200, there are lots of formulas inside referencing each other. I want to set the value in column R to be equal to 1 exactly by changing the value in column C and then do this independently for each row.

    I have tried some basic code and after playing around I can get it to run for the first row (15) only and then it stops and doesn't loop down to solve the remaining hundreds of rows.

    Sub Macro6()
    '
    ' Macro6 Macro
    '

    '
    SolverReset
    SolverOk SetCell:="$R$15", MaxMinVal:=3, ValueOf:=1, ByChange:="$C$15", Engine _
    :=1, EngineDesc:="GRG Nonlinear"
    SolverAdd CellRef:="$R$15", Relation:=1, FormulaText:="4"
    SolverSolve
    End Sub

  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: Solver VBA Loop Basic

    Welcome to the board.

    Please Login or Register  to view this content.
    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.
    Entia non sunt multiplicanda sine necessitate

+ 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] New to Visual Basic, Help designing Macro to Run Solver Automatically on Data Set
    By bellr10 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-18-2015, 06:26 PM
  2. Using Solver in a VBA loop
    By blitz13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2013, 01:24 PM
  3. loop with solver
    By byueill in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-16-2012, 01:41 PM
  4. Basic loop
    By drchris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-02-2010, 12:02 PM
  5. Basic Solver Problem
    By Sige in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-06-2006, 12:00 PM
  6. [SOLVED] Solver in Visual Basic
    By Cardiff Maths Student in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-05-2005, 11:06 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