Results 1 to 6 of 6

VBA script for running Solver in loop

Threaded View

confusedguy VBA script for running Solver... 10-31-2011, 02:51 AM
foxguy Re: VBA script for running... 10-31-2011, 02:58 AM
confusedguy Re: VBA script for running... 10-31-2011, 03:07 AM
foxguy Re: VBA script for running... 10-31-2011, 03:19 AM
foxguy Re: VBA script for running... 10-31-2011, 03:46 AM
confusedguy Re: VBA script for running... 10-31-2011, 03:54 AM
  1. #1
    Registered User
    Join Date
    10-31-2011
    Location
    Outside US
    MS-Off Ver
    Excel 2007
    Posts
    3

    VBA script for running Solver in loop

    I am running a VBA script for running solver in loop. The code looks as follows:
    For i = 0 To 200
            SolverOk SetCell:=Range("$FF308").Offset(i, 0), MaxMinVal:=2, ValueOf:="0", ByChange:=Range("$BA$308:$BF$308").Offset(i, 0)
            SolverSolve
    Next i
    The problem is that each time the solver finishes solving, it invokes a dialog box which asks me if I would like to keep the solution or restore to original values. This means I have to press enter each time the solver solves. I have to use the solver in a loop for 2000 times, which means I have to press enter 2000 times. Is there any way I can automate this pressing Enter part?
    ~Thanks in advance.
    Last edited by confusedguy; 10-31-2011 at 04:01 AM.

Thread Information

Users Browsing this Thread

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

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