Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Solver Code
I am using a solver reference in my code like this:
SolverOk SetCell:="$c$22", MaxMinVal:=3, ValueOf:="0", ByChange:="$c$18" SolverSolve (True) However I need to do this repetitively so I would like to change $c$22 to something like (looper+5,5). However, when I try to use a cell reference like that, I get an error message. Thanks for the help. -- Paul |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Solver Code
On Fri, 13 May 2005 11:32:02 -0700, "Paul" wrote in microsoft.public.excel.programming:
I am using a solver reference in my code like this: SolverOk SetCell:="$c$22", MaxMinVal:=3, ValueOf:="0", ByChange:="$c$18" SolverSolve (True) However I need to do this repetitively so I would like to change $c$22 to something like (looper+5,5). However, when I try to use a cell reference like that, I get an error message. Thanks for the help. Maybe this can help: strCell = Cells(looper + 5, 5).Address SolverOk SetCell:=strCell, MaxMinVal:=3, ValueOf:="0", ByChange:="$c$18" or shorter: SolverOk SetCell:=Cells(looper + 5, 5).Address, MaxMinVal:=3, ValueOf:="0", ByChange:="$c$18" Depending on your circumstances, you may need to qualify Cells(). -- Michael Bednarek http://mbednarek.com/ "POST NO BILLS" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Interesting Solver problem (Solver encounters an error) | Excel Discussion (Misc queries) | |||
The VBA code for solver does not pick up 'change cells' and 'set . | Excel Programming | |||
VBA Code for Solver | Excel Programming | |||
VBA code to add a reference to solver | Excel Programming | |||
Solver code does not save results to sheet - What am I missing?! | Excel Programming |