Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interesting Solver problem (Solver encounters an error) MrShorty Excel Discussion (Misc queries) 3 December 22nd 05 10:52 PM
The VBA code for solver does not pick up 'change cells' and 'set . vineet Excel Programming 0 March 2nd 05 06:11 PM
VBA Code for Solver David Excel Programming 1 October 21st 04 07:33 PM
VBA code to add a reference to solver Tbeek[_3_] Excel Programming 5 April 7th 04 04:46 PM
Solver code does not save results to sheet - What am I missing?! Simon Livings Excel Programming 0 January 16th 04 03:55 PM


All times are GMT +1. The time now is 03:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"