Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to put the value from Excel's solver function into
memory rather than a cell in Excel? My intention is to use solver to get a value and use that value in another function. However, the fist value that I get from solver might not work with my function. That is why I want to vary the initial value with a loop and be able to save the value from solver in memory rather than in Excel. Below is the code that I have. It writes the value from solver to a cell in Excel. Sub Macro2solver() solverreset SolverOk SetCell:="$E$29", MaxMinVal:=3, ValueOf:="0", ByChange:="$E$26" SolverSolve UserFinish:=True SolverFinish KeepFinal:=1 End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A good place to store stuff like this is in a static array. If we insert:
Dim memory(100) as Double Dim Cntr as Integer At the very top of the module (above the subs ), then in the subs we can put: Cntr=Cntr + 1 memory(Cntr) = Range("E26").value This will keep a "history" of the solutions. -- Gary''s Student - gsnu2007 "Jonas" wrote: Is it possible to put the value from Excel's solver function into memory rather than a cell in Excel? My intention is to use solver to get a value and use that value in another function. However, the fist value that I get from solver might not work with my function. That is why I want to vary the initial value with a loop and be able to save the value from solver in memory rather than in Excel. Below is the code that I have. It writes the value from solver to a cell in Excel. Sub Macro2solver() solverreset SolverOk SetCell:="$E$29", MaxMinVal:=3, ValueOf:="0", ByChange:="$E$26" SolverSolve UserFinish:=True SolverFinish KeepFinal:=1 End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
solver an uxexpected internal error ocurred, or available memory | Excel Worksheet Functions | |||
XL 2007 - Out of Memory - memory leak/bug? | Excel Discussion (Misc queries) | |||
Solver: An unexpected internal error occurred, or available memory was... | Excel Programming | |||
Solver: An unexpected internal error occurred, or available memory | Excel Programming | |||
VBA & Solver Memory Usage | Excel Programming |