Hi There,
This is my first post so please forgive my ignorance. I read the forum rules and think I am not infringing them.
I have a problem related to optimization of a number of variables. I am calling the solver in a loop and I wrote a criterium function which resides in the Solver SetCell of the worksheet. The code works fine and the solver dumps all optimized variables once the loop is completed and the macro code ended. So far so good. However I would like to get better results by using the optimized variables from one step as starting values to calculate the optimized variables in the next step in the loop. I am not able to force solver to give the optimized variables in the completed step of the loop.
Conceptually the code looks like:
For i = 1 to 31
'code to compile ChangeString relevant for this i
'Note cell "$K$10" contains the Criterium Function which consist of some hundered lines of code.
solverReset
SolverOk SetCell:="$K$10", MaxMinVal:=2, ValueOf:=0, ByChange:=ChangeString, _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverFinish KeepFinal:=1
SolverSolve (True)
SolverReset
'==> Here I would like to obtain the optimized values from step i as starting values for step i+1
'==> So I would write them in the "By Changing Variable Cells" for the next i
Next i
I really tried to find this on the Internet but did not succeed.
Any help is appreciated.
Thank you
Roel
Bookmarks