Este Es El Código Del Modulo
Este Es El Código Del Modulo
Option Explicit
Option Base 1
Sub GoToExplanation()
' Navega de regreso a la hoja Entrada.
Worksheets("Entrada").Activate
Range("F8").Select
End Sub
Sub Setup()
' Obtiene las entradas del usuario.
UserForm1.Show
End Sub
Sub RunSolver()
Application.ScreenUpdating = False
' La hoja Model debe ser visible y debe estar activada para poder correr Solver.
With Worksheets("Modelo")
.Visible = True
.Activate
End With
' Run Solver and check for feasibility. (The code for no feasible solutions is 5.)
' If there is a feasible (hence optimal) solution, show it on the Report sheet.
' Otherwise, report that there are no feasible solutions.
If SolverSolve(UserFinish:=True) <> 5 Then
Worksheets("Reporte").Activate
Else
MsgBox "The Solver couldn't find a solution. Try a different " _
& "set of inputs.", vbExclamation, "No solution"
Call GoToExplanation
End If