Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wrote the following code to quickly obtain optimum values using Solver.
The code is below. Sub quikSolv(rngSolver_Target As Range, rngSolver_Output As Range, iMaxMinVal As Integer) ' This macro uses SOLVER to set the traget cell to zero by changing the output cell SolverReset SolverOk SetCell:=rngSolver_Target.Address, MaxMinVal:=iMaxMinVal, ValueOf:="0", _ ByChange:=rngSolver_Output.Address SolverAdd CellRef:=rngSolver_Output.Address, Relation:=3, FormulaText:="0" SolverSolve True End Sub To make my code and spreadsheets easier to read, I am using six named ranges in other routines, and I am sending them to the above macro. However, even though I am using the Range.Address property to assign the Solver parameters, Solver keeps changing the address to the string of the named range. Then, it fails to optimize, saying "Set Target Cell contents must be a formula." Is there any way around this? Thanks, Pflugs |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
solver ranges | Excel Programming | |||
union of named ranges based only on the names of those ranges | Excel Programming | |||
Copy data in named ranges to a newer version of the same template to identical ranges | Excel Programming | |||
Like 123, allow named ranges, and print named ranges | Excel Discussion (Misc queries) | |||
named ranges - changing ranges with month selected | Excel Programming |