Excel - macros y solver

 
Vista:

macros y solver

Publicado por daniel loncon (1 intervención) el 30/10/2008 05:27:08
hola quisiera ver si me pueden ayudar con un problema que tengo....
necesito resolver un modelo con solver...pero darle la instruccion al solver de resolucion desde una macro....mas bien desde el boton de una macro....ese no es el problema pues lo hace....el problema es que despues de encontrar una solucion no me muestra la solucion en la hoja de excel....¡¡¡¡alguien me puede ayudar por favor!!!!!...necesito visualizar la solucion en excel...aqui va el codigo que programe en el boton...

Gracias...
Private Sub CommandButton4_Click()
Sheet1.Activate
SolverOptions MaxTime:=100, Iterations:=100, Precision:=0.000001, _
AssumeLinear:=True, StepThru:=False, Estimates:=1, _
Derivatives:=1, IntTolerance:=5, Scaling:=False, Convergence:=0.0001 _
, AssumeNonNeg:=True
SolverOK SetCell:="$C$36", MaxMinVal:=1, ValueOf:="0", _
ByChange:="$F$15:$F$18"
SolverAdd CellRef:="$D$34", Relation:=2, FormulaText:="$F$34"
SolverAdd CellRef:="$F$15", Relation:=1, FormulaText:="20000"
SolverAdd CellRef:="$F$15:$F$18", Relation:=2, FormulaText:="INTEGER"
SolverAdd CellRef:="$F$16", Relation:=1, FormulaText:="20000"
SolverAdd CellRef:="$F$17", Relation:=1, FormulaText:="20000"
SolverAdd CellRef:="$F$18", Relation:=1, FormulaText:="$E$27"
SolverAdd CellRef:="$F$18", Relation:=1, FormulaText:="20000"
SolverAdd CellRef:="$F$22", Relation:=1, FormulaText:="$H$22"
SolverAdd CellRef:="$F$22", Relation:=3, FormulaText:="$G$22"
SolverAdd CellRef:="$F$23", Relation:=1, FormulaText:="$G$23"
SolverAdd CellRef:="$F$24", Relation:=1, FormulaText:="$G$24"
SolverAdd CellRef:="$F$25", Relation:=1, FormulaText:="$G$25"
SolverSolve UserFinish:=False

End

End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder