Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello. New guy here so please be gentle. :) From searching the internet, I've learned that the 2nd function of SolverSolve can be called to count the number of iterations performed by Solver, ie: SolverSolve (1st_function, 2nd_function). Here's the code I found, however I can not make it to run. Where do I put the code in the VBA program? I mean what would be the complete SolverSolve command? Code: -------------------- Global count as integer Sub test() count = 0 ret = solveroptions(stepthru:=True) '"checks" the Show Iteration checkbox in Tools/Solver/Options ret = solversolve(True, "showtrial") MsgBox count End Sub Function showtrial(reason As Integer) If reason = 1 Then 'reason = 1 means that the function will be called on each iteration. count = count + 1 'increments global variable End If showtrial = 1 ' continues Solver End Function -------------------- Thanks in advance! -- zaina ------------------------------------------------------------------------ zaina's Profile: http://www.excelforum.com/member.php...o&userid=24316 View this thread: http://www.excelforum.com/showthread...hreadid=379230 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Solver problem where 'IF Function' is bad | Excel Discussion (Misc queries) | |||
is there anyway to call the Solver add-in as a function? | Excel Programming | |||
is there anyway to call the Solver add-in as a function? | Excel Programming | |||
How does Solversolve Control Macro | Excel Programming | |||
How to call SolverSolve portably for Excel XP and Excel 2000 | Excel Programming |