Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello!
Which would be the correct command in solver macro to shut solverresults-window after iteration? SolverFinish doesn't do that. Hannu Rantala |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think you want to use the following:
SolverSolve True If you wish to use the results with "SolverFinish", then here is just one idea. Sub Demo() '// Dana DeLouis Dim WhatHappened Const KeepSolution = 1 Const DiscardSolution = 2 '// Don't display Solver WhatHappened = SolverSolve(True) Select Case WhatHappened Case 1 To 3 'Solution should be ok SolverFinish KeepSolution Case Else SolverFinish DiscardSolution End Select End Sub HTH. :) -- Dana DeLouis Using Windows XP & Office XP = = = = = = = = = = = = = = = = = "Hannu Rantala" wrote in message om... Hello! Which would be the correct command in solver macro to shut solverresults-window after iteration? SolverFinish doesn't do that. Hannu Rantala |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Dana DeLouis" wrote in message ...
I think you want to use the following: SolverSolve True If you wish to use the results with "SolverFinish", then here is just one idea. Sub Demo() '// Dana DeLouis Dim WhatHappened Const KeepSolution = 1 Const DiscardSolution = 2 '// Don't display Solver WhatHappened = SolverSolve(True) Select Case WhatHappened Case 1 To 3 'Solution should be ok SolverFinish KeepSolution Case Else SolverFinish DiscardSolution End Select End Sub HTH. :) -- Dana DeLouis Using Windows XP & Office XP = = = = = = = = = = = = = = = = = Hello! Having problems with code...how to use the command above? i have this kind of code now: Private Sub CommandButton1_Click() Worksheets("Taul2").Activate SolvReset SolvOptions AssumeNonNeg:=True SolvOk SetCell:="B22", MaxMinVal:=3, ValueOf:="0", ByChange:="B5,B7,B9" SolvAdd CellRef:="B4", Relation:=2, FormulaText:="B6" SolvAdd CellRef:="B5", Relation:=2, FormulaText:="B8" SolvSolve SolvReset SolvOptions AssumeNonNeg:=True SolvOk SetCell:="C22", MaxMinVal:=3, ValueOf:="0", ByChange:="C5,C7,C9" SolvAdd CellRef:="C4", Relation:=2, FormulaText:="C6" SolvAdd CellRef:="C5", Relation:=2, FormulaText:="C8" SolvSolve |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Dana DeLouis" wrote in message ...
I think you want to use the following: SolverSolve True If you wish to use the results with "SolverFinish", then here is just one idea. Sub Demo() '// Dana DeLouis Dim WhatHappened Const KeepSolution = 1 Const DiscardSolution = 2 '// Don't display Solver WhatHappened = SolverSolve(True) Select Case WhatHappened Case 1 To 3 'Solution should be ok SolverFinish KeepSolution Case Else SolverFinish DiscardSolution End Select End Sub HTH. :) -- Dana DeLouis Using Windows XP & Office XP = = = = = = = = = = = = = = = = = Ohhoh! I must be very good sleeping programmer! SolverFinish True does exactly what I want. Forget my previous message. And thanks for help because your notification woke me up! Hannu |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|