Solver

Hi Group,

I am having a hard time programming Solver. This is the code I have so far:
Sub SolveNew()
  Worksheets(ActiveSheet.Name).Activate
  SolverReset
  SolverOptions precision:=0.001
  SolverOk SetCell:="$C$48", MaxMinVal:=3, ValueOf:="100000", ByChange:= _
      "$C$32,$C$34,$C$36,$C$38,$C$40,$C$42,$C$44"
  SolverAdd CellRef:="$C$33", Relation:=2, FormulaText:="$C$35"
  SolverAdd CellRef:="$C$35", Relation:=2, FormulaText:="$C$37"
  SolverAdd CellRef:="$C$37", Relation:=2, FormulaText:="$C$39"
  SolverAdd CellRef:="$C$41", Relation:=2, FormulaText:="$C$43"
  SolverAdd CellRef:="$C$43", Relation:=2, FormulaText:="$C$45"
  SolverAdd CellRef:="$C$49", Relation:=2, FormulaText:="$C$48*0.35"
  SolverAdd CellRef:="$C$50", Relation:=2, FormulaText:="$C$49*0.25"
  SolverOk SetCell:="$C$48", MaxMinVal:=3, ValueOf:="100000", ByChange:= _
      "$C$32,$C$34,$C$36,$C$38,$C$40,$C$42,$C$44"
  SolverSolve
End Sub

I know there is a solution, but it keeps telling me there is not a solution.

Thanks,
David
-- 
David
0
Utf
6/7/2010 5:16:56 PM
excel.programming 6508 articles. 2 followers. Follow

0 Replies
1194 Views

Similar Articles

[PageSpeed] 38

Reply:

Similar Artilces:

solver #12
How can I use solver, or some other excel application to force the sum of a column to equal a specified number, by allowing the numbers being summed to either be changed to 0 or remain exactly the same? It is essentially to determine which 50 or so of 100+ deposits are included in an enormously large sum (1 large deposit total). the only way to do that is use VBA and think of an algoritm to solv your sum. If you want to calculate all possebility's don't be surprised to wai for several years before it would have the best solution if there i any. it's an exploding situation ...

solver...
I have four cells that I enter numbers into and the rest of the sheet has formulas setup. Is there a way to have excel try different numbers until it finds the max value in a certain cell? I believe I would use solver but I can't get it to work. I enter numbers in cells B5, B8, B11, and B14. I want cells K2, K5, K8, K11, K14, K17, and K20. Is there a way to do this? Thanks. ...

Solver slow
I have a large workbook that includes a macro that first sets calculation mode to manual and then starts the Solver. All data and calculations used by the Solver are located in a single worksheet. It is really slow. It is like if the Solver is doing an "Application.Calculate" at each iteration, calculating all worksheets, which would make sense. - Am I right thinking that the Solver use "Application.Calculate"? - If yes, is it possible to specify to the Solver to calculate only a given worksheet? Thanks. ...

Solver parameter constraint question
Here is my question: Let's say cell A1 is the cell to be changed and I want to restrict th value of it to 1, 2, 3, 4, 7, 10, 100, or 500. A1 must be chosen fro one of those values, how can I set up the constraints for thi situation? Thank you -- Morriga ----------------------------------------------------------------------- Morrigan's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=709 View this thread: http://www.excelforum.com/showthread.php?threadid=37692 Hi: Try this. =IF(OR(A1={1,2,3,4,7,10,100,500}),"Correct","No good") Mat ...

Solver
Solver is pretty good but it appears to have a few drawbacks. It is not a function, so you have to run it by hand every time. And it leaves all previously calculated values changed. I am cooking up a hydraulic flow sheet in which each line provides for entry of some values like channel depth and width, and produces values like velocity and energy. I need to show a column for the depth at which the energy is minimized. So I varied depth in Solver and got a believable value for the min. energy and the depth that produces it. Is there a function which will do that? There are a number of solver ...

Using the solver
I've just learned how to use the solver add-in to solve sets of equations. The problem is that this particular set (let's call the unknowns x and y) has an infinite amount of solutions as long as x is 5 time bigger than y. This means that 5 and 1 is equal to 5000 and 1000. My solver for some reason doesn't find the lowest usable values (it probably doesn't care either), but it would be nice to have it return more "pleasant" values like 5 and 1 instead of 5000 and 1000. Can it be "told" to do so, or can I make it happen in some other way? -- Siberian ----...

Solver #14
Is there a layman's guide for 'solver' in Excel? I would appreciate any feedback. Hi Saxman, See: http://www.che.boun.edu.tr/che477/xls477.html --- Regards, Norman "Saxman" <john.h.williams(removethis)@btinternet.com> wrote in message news:2qiwxm9k9f7u$.zbhxmgckmwg4.dlg@40tude.net... > Is there a layman's guide for 'solver' in Excel? I would appreciate any > feedback. In article <2qiwxm9k9f7u$.zbhxmgckmwg4.dlg@40tude.net>, Saxman <john.h.williams(removethis)@btinternet.com> says... > Is there a layman's guide ...

Solver
Hi Group, I am having a hard time programming Solver. This is the code I have so far: Sub SolveNew() Worksheets(ActiveSheet.Name).Activate SolverReset SolverOptions precision:=0.001 SolverOk SetCell:="$C$48", MaxMinVal:=3, ValueOf:="100000", ByChange:= _ "$C$32,$C$34,$C$36,$C$38,$C$40,$C$42,$C$44" SolverAdd CellRef:="$C$33", Relation:=2, FormulaText:="$C$35" SolverAdd CellRef:="$C$35", Relation:=2, FormulaText:="$C$37" SolverAdd CellRef:="$C$37", Relation:=2, FormulaText:="$C$39...

Solver #11
Is it possible to have two separate Solver solutions operating in a on page workbook in Excel 2003? I have two sets of data on on spreadsheet page both require the use of Solver. The data sets ar independant of each other. I can set Solver to work with one set onl and would like to also use Solver on the other set without creating second worksheet. Thanks in advance, Janu -- Janu ----------------------------------------------------------------------- Janus's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2689 View this thread: http://www.excelforum.com/showt...

SOLVER Reset command does not work in 2007Excel why???? Two Questi
Private Sub CommandButton4_Click() SolverReset SolverAdd CellRef:="$B$8:$E$8", Relation:=3, FormulaText:="$B$9:$E$9" SolverAdd CellRef:="$B$8:$E$8", Relation:=1, FormulaText:="$B$10:$E$10" SolverAdd CellRef:="$F$8", Relation:=2, FormulaText:="100%" SolverOk SetCell:="$J$6", MaxMinVal:=1, ByChange:="$B$8:$E$8" SolverSolve userFinish:=True SolverFinish KeepFinal:=1 End Sub Cann't Find Project or Library. IT IS CLEARLY SHOWN THAT Solver.xlam is referenced,which I have ensur...

Sudoku puzzle solver
For those of you who do (or, like me, try to solve) the Sudoku number puzzles that appear in newspapers, I have a freeware Excel program to do that. If you send a request to scientific_resources@hotmail.com with Sudoku in the Subject line, I will send it to you. File size 24K, zipped. Requires Excel97 or later. Unprotected workbook with access to all code, freeware. Gord. For US citizens: Sudoku is a crossword-like puzzle that uses numbers. It has become very popular in the UK - every third person on the subway is trying to solve one! -- Bernard V Liengme www.stfx.ca/people/bliengme ...

Solver
Hi, I would like to use Solver, but it is the first time I've been working with it. My problem: I have a group of 6 numbers, which are counted at the bottom: 6,43 12,11 2,31 42,84 50,29 27,95 141,93 I wanted Sovlver helped me to decrease the number 141,93 to 41,93 by changing all the numbers above, but it should use the same percentage at every number. How to adjust the Solver? Thanx Marian As regards using solver, its just a case of changing the way you've structured the problem - use a factor to multply each number, and solve where that factor is the variable. However, in...

Solver, Macros and Range Names
Hello, I have been running a Goal Seek macro and using range names instead of cell references. I now want to change the goal seek macro to a Solver macro but when i record the macro it will not let me change the macro cell references to the range names. Is it possible to change this? Thanks Nick Well, you can always make the substitution by hand. Suppose you record SolverOk SetCell:="$B$2", MaxMinVal:=2, ValueOf:="0", ByChange:="$B $1" SolverAdd CellRef:="$B$1", Relation:=1, FormulaText:="0" SolverSolve where B1 is named...

solver question: educational premium solver
Hello, I'm taking a systems and industrial engineering class, and we're using: Optimization Modeling with Spreadsheets by Kenneth R. Baker. This book has a cd with the premium solver, educational version. The problem is that it just won't work with excel 2007 and we're at the point now when we HAVE to use the extended solver, not just the one that comes with excel. I went to the website and they require a class code and a book code to download the latest educational version that works with excel 2007. I don't know what the book code is, all I see behind my book is the isbn...

excel solver #3
how can i have the solver on excel ? Hi Thanos, The Solver is an add-in. To see if it's available goto Tools>Add-Ins. If it's in the list that appears click in the ckbox then select OK. If it's not in the list, then you will have to install it from the original distribution disk. You can do this in Add/Remove Programs. Biff >-----Original Message----- >how can i have the solver on excel ? >. > ...

Interesting Solver problem (Solver encounters an error)
Here's an interesting problem, I wonder if anyone has any thoughts o this. Recognize that my real problem is very complex (severa intermediate calculation including some iterative steps), but th problem I'm having seems similar (conceptually anyway) to this simpl problem. Given a data set: x,y 10,3.9 8,3.2 7,2.8 6,2.2 5,1.4 4.5,0.8 4,0.01 3.8,-0.4 3.6,-1 3.5,-1.4 3.4,-1.8 3.3,-2.4 3.2,-3.2 3.1,-4.6 3.05,-6 One could look at the data and say, "that looks like the curve y=ln(x) but with a different asymptote other than the y-axis and possibly scaling factor." So we choos...

Solver does not find correct solution???
Hello, I have recently had a problem with excel's solver (until last week I never had a porblem). When fitting a data set (trying to minimize my target cell), the solver says that either it has found a solution or that the data doesn't converge. When I run the solver again, my target cell is further reduced or the cells don't converge again. When running my spreadsheet on a colleagues computer, there is no problem, so I know the problem isn't with my data. Any help or suggestions would be greatly appreciated! Thanks in advance. experiment626 - Check (and perhaps a...

Looking for total
Greetings, I have a very large range of numbers. What I am looking for is the multiple combination of values to give me the preestablished sum of "x". Is there a method or tool that can help this process? Thanks in advance! -Drew Hi, A spreadsheet was posted here a few months ago that does what you're looking for I think - if you send me your email address, I'll send it to you. (remove NOSPAM) jreese51NOSPAM@bellsouth.net jeff >-----Original Message----- >Greetings, > >I have a very large range of numbers. What I am looking >for is the multiple comb...

Solver Logic
Hi, Can anyone please help me with the logic that solver uses at the back end, specially for the cases where it doesnt assume a "Linear Model". It would really help if the logic behind every iteration can be detailed. I am trying to develop something similar in a different system and hence need this help. Regards Shreejith Menon 98210 71845 > ...the logic that solver uses at the back end, > specially for the cases where it doesn't assume a "Linear Model". Hi. Hope this helps in some way. :>) XL2000: Solver Uses Generalized Reduced Gradient Algorithm ht...

Solver issue
Hi, Can any one tell me, is it possible to use a older version of solver (solver with office 97) in office 2003? Because I am having a problem with the new solver. i.e. Can I place the older version of solver in another location, and try to load it in office 2003, without disturbing the new solver with 2003. Please help. Thanks G.Lakshmi Hello. I don't have a solution to your question. Just out of curiosity, what kind of problems are you having with xl 2003? The reason I mention this is the following: Here in the newsgroups, it is sometimes mentioned that "discontinuous&qu...

Solver Documentation
Not sure if this is the correct place to ask, but I am looking for decent documentation on the attributes & functionality of the Solver Excel add-in. Thank you. Regards, Diane Check out http://www.frontsys.com/xlhelp.htm Frontline Systems is the maker of Solver. In article <4a3d01c3ffa0$36324420$a401280a@phx.gbl>, "Diane" <dialsing@yahoo.com> wrote: > Not sure if this is the correct place to ask, but I am > looking for decent documentation on the attributes & > functionality of the Solver Excel add-in. > > Thank you. > Regards, &...

Solver
I am using solver for an assignment. I have all the constraints in the table and have entered in. When I go to solve the equation, it runs it and the cells come up 0. This is incorrect as I am doing a distribution plan where you have to transport cases and minimize the costs. Does anyone know what the problem could be. If anyone is willing then you could me your e-mail and have a look at it directly and have a look at it. Cheers Martin -- BONJOVI2005 this is kinda late; but, any blank cell,space, null, will make the calculation 0. cisco7970 "BONJOVI2005" wrote: > > ...

solver help
Hi, I recently started using excel solver. Apparently solver works perfectly and just stops solving all of a sudden as I make the problem a little bit more complex. The problem it selve is very basic allocation amounts in asset classes based on returns. It intially does this but if add sub totals it stops. Hope i can get some help. Taha On May 24, 9:12=A0am, Taha Ahmed <tahaahme...@googlemail.com> wrote: > I recently started using excel solver. Apparently solver > works perfectly and just stops solving all of a sudden > as I make the problem a little bit more complex. [....]...

Solver Constraints...
Hi All, I would like to use solver to solve a problem I am facing with at present. I am refitting floorboards in my room and would like to minimize wasting material. Floor boards are the same width and come in varyaing lengths (i.e. I can cut them shorter) and should be laid down in the same way across the whole room. Furthermore, 3 or more floorboards are required to cover one length of the room. Question... My original idea was to have just one area constraint (i.e. the sum of the area of the boards used should >= the sum of the area of the room), but then I thought that thi...

Solver and polynomials
trying to figure out how to use solver to solve a fourth orthe polynomial. i.e i have a 4th order polynomial of the form y=f(x), but want x=f(y -- Geo_D ----------------------------------------------------------------------- Geo_DW's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2405 View this thread: http://www.excelforum.com/showthread.php?threadid=37658 This should do it: http://www.tushar-mehta.com/excel/software/polynomials/index.html Hope it helped Ola Sandstr´┐Żm -- olasa ------------------------------------------------------------------------ olasa...