Results 1 to 12 of 12

Excel 2010 Looping solver macro

Threaded View

  1. #1
    Registered User
    Join Date
    09-16-2013
    Location
    Norfolk, UK
    MS-Off Ver
    Office 2010 Windows / Office 2011 Mac
    Posts
    6

    Excel 2010 Looping solver macro

    Hello,

    I'm relatively new to VB, and to the forum, I'd appreciate your help with the following.

    I'm trying to use solver to optimise a value in cell O5 so that it's identical to a value in cell P5 by changing cells E5 & F5. I'm also trying to loop the code so that the sequence is repeated for every subsequent row until row 781.

    I've so far tried using the following code, but to no avail:

    Sub SolverMacro()
    Dim r As Long
    For r = 2 To 781
        SolverOk SetCell:="O5", MaxMinVal:=0, ValueOf:=Range("P5").Value, ByChange:="E5:F5", _
            Engine:=1, EngineDesc:="GRG Nonlinear"
        SolverSolve UserFinish:=True
    Next r
    End Sub
    Can anyone point out where I'm going wrong, or give me any pointers please?
    Last edited by RG84; 09-16-2013 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. [SOLVED] Find All function looping in Excel 2010
    By XML2005 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-12-2013, 12:02 AM
  2. Solver don't work in excel 2010
    By masben in forum Excel General
    Replies: 5
    Last Post: 02-27-2013, 11:20 AM
  3. [SOLVED] Looping Through Sheets in a workbook in Excel 2010
    By Johnr1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-26-2012, 05:09 AM
  4. Solver macro (2010) does not work in 2007
    By goldenaggregate in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-05-2012, 09:59 AM
  5. Using Solver from VBA Excel 2010
    By secret2 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-05-2012, 07:12 PM

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