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: 2
Default SolverAdd

I am trying to use the Solver function and have trouble to get the
constraints set up properly. Of the 4 constraints only 2 are used as I can
tell by the result as well as by looking at the Solver Parameter window in
which only constraints 2 and 4 are listed. Changing for example the sequence
didn't help.

Version: Excel 2002 SP3, VB 6.3

- Bernd


Sub Macro1()

' Reset - Clear all previous settings
SolverReset

' Precision 0.1%; Use quadratic extrapolation
SolverOptions precision:=0.001, estimates:=1

' Minimize value for 1st dimentsion
SolverOk SetCell:=Range("$M$21"), _
MaxMinVal:=2, _
ByChange:=Range("$B$21:$k$21")

' Constraint 1 - Upper limit for weights
SolverAdd cellRef:=Range("$B$21:$k$21"), _
relation:=1, _
formulaText:=1

' Constraint 2 - Lower limit for weights
SolverAdd cellRef:=Range("$B$21:$k$21"), _
relation:=3, _
formulaText:=0

' Constraint 3 - Sum of all weights equal 100%
SolverAdd cellRef:=Range("$a$21"), _
relation:=2, _
formulaText:=1

' Constraint 4 - Target value for 2nd dimension
SolverAdd cellRef:=Range("$L$21"), _
relation:=2, _
formulaText:=Range("$o$21")

SolverSolve Userfinish:=True

End Sub
 
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
Problem with SolverAdd. Can anyone help? Tim Anderson[_2_] Excel Programming 3 December 16th 03 08:48 PM
Problem implementing SolverAdd - Can anyone solve? Tim Anderson[_2_] Excel Programming 0 December 15th 03 07:09 PM


All times are GMT +1. The time now is 12:17 PM.

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"