LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Solver macro


I am trying to write a macro that uses Solver. The solver is set to Set
Target Cell Equal To a Value Of (as opposed to a max or min value).

I can not work out a way to let the Value Of figure be referenced to
another cell, rather than just one, predetermined, value. Is this
possible? If so, how do I do it?

Any help much appreciated!

Extract from unsuccessful macro shown below:

(ValueOf:=Range("$F$28") is the bit that doesn't work)


SolverOk SetCell:=Range("$F$6"), MaxMinVal:=3,
ValueOf:=Range("$F$28"), ByChange:=Range("$B$2:$B$4")
SolverAdd CellRef:=Range("$B$3"), Relation:=1, FormulaText:="7"
SolverAdd CellRef:=Range("$B$3"), Relation:=3, FormulaText:="1.01"
SolverAdd CellRef:=Range("$B$4"), Relation:=1,
FormulaText:="-0.001"
SolverAdd CellRef:=Range("$B$4"), Relation:=3,
FormulaText:="-0.065"
SolverAdd CellRef:=Range("$D$21"), Relation:=2,
FormulaText:=Range("$D$24")
SolverOk SetCell:=Range("$F$6"), MaxMinVal:=3,
ValueOf:=Range("$F$28"), ByChange:=Range("$B$2:$B$4")
SolverOptions MaxTime:=100, Iterations:=100, Precision:=0.01,
AssumeLinear:= _
False, StepThru:=False, Estimates:=1, Derivatives:=1,
SearchOption:=1, _
IntTolerance:=5, Scaling:=False, Convergence:=0.001,
AssumeNonNeg:=False
SolverOk SetCell:=Range("$F$6"), MaxMinVal:=3,
ValueOf:=Range("$F$28"), ByChange:=Range("$B$2:$B$4")
SolverSolve
End Sub


--
TobP
------------------------------------------------------------------------
TobP's Profile: http://www.excelforum.com/member.php...o&userid=25149
View this thread: http://www.excelforum.com/showthread...hreadid=386415

 
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
Is it possible to run Solver using a macro? EA405 Excel Worksheet Functions 1 May 2nd 06 08:05 PM
SOLVER macro emilija Excel Programming 1 April 22nd 05 02:29 PM
Solver Macro Michael Excel Programming 2 May 21st 04 03:13 PM
Using Solver within Macro Avner Mediouni Excel Programming 1 October 27th 03 12:08 AM
Solver Macro Dick Stumbo Excel Programming 0 September 18th 03 01:55 AM


All times are GMT +1. The time now is 08:59 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"