I am trying to run the code below. When I run this, I am getting the following error message:
OpenSolver Could not find an optimal solution, and reported: Infeasible
The Model contains a restraint 'I2:I160 >=1' for which instance 4does not depend on the decision variable and is not satisfied.
Constraint specifies: LHS=I5>=RHS=1=1
No Solution was available to load into the spreadsheet.
This is the code from the VBA. I am trying to add the code below in green. It should be that if the value in column I is >=0, then it is available to use the data for the row.
For example: If row 6 has a value of 4 in I6, then it can be included in the solution, If row 7 has a value of 0 in I7, then it should not be included in the solution.
I am trying to avoid putting each row in the constraints, as the number of rows varies over time.
' SolverOkSetCell:="$L$3", MaxMinVal:=1, ValueOf:=0, ByChange:="$A$2:$A$160",_
' Engine:=1,EngineDesc:="GRG Nonlinear"
' SolverAdd CellRef:="$A$2:$A$160", Relation:=5,FormulaText:="binary"
' SolverAdd CellRef:="$L$10",Relation:=1, FormulaText:="$L$5"
' SolverAdd CellRef:="$L$10", Relation:=3,FormulaText:="$L$6"
' SolverAdd CellRef:="$L$9",Relation:=2, FormulaText:="$L$8"
'SolverAddCellRef:="$L$3", Relation:=1, FormulaText:="$L$12"
' 'if Remaining (Column I) >=1,use, if <=1 skip
' SolverAdd CellRef:=" I$2:$I$160",Relation:=3, FormulaText:="1"
Please let me know if you have any ideas or if this doesn't make sense or is not possible.
OpenSolver Could not find an optimal solution, and reported: Infeasible
The Model contains a restraint 'I2:I160 >=1' for which instance 4does not depend on the decision variable and is not satisfied.
Constraint specifies: LHS=I5>=RHS=1=1
No Solution was available to load into the spreadsheet.
This is the code from the VBA. I am trying to add the code below in green. It should be that if the value in column I is >=0, then it is available to use the data for the row.
For example: If row 6 has a value of 4 in I6, then it can be included in the solution, If row 7 has a value of 0 in I7, then it should not be included in the solution.
I am trying to avoid putting each row in the constraints, as the number of rows varies over time.
' SolverOkSetCell:="$L$3", MaxMinVal:=1, ValueOf:=0, ByChange:="$A$2:$A$160",_
' Engine:=1,EngineDesc:="GRG Nonlinear"
' SolverAdd CellRef:="$A$2:$A$160", Relation:=5,FormulaText:="binary"
' SolverAdd CellRef:="$L$10",Relation:=1, FormulaText:="$L$5"
' SolverAdd CellRef:="$L$10", Relation:=3,FormulaText:="$L$6"
' SolverAdd CellRef:="$L$9",Relation:=2, FormulaText:="$L$8"
'SolverAddCellRef:="$L$3", Relation:=1, FormulaText:="$L$12"
' 'if Remaining (Column I) >=1,use, if <=1 skip
' SolverAdd CellRef:=" I$2:$I$160",Relation:=3, FormulaText:="1"
Please let me know if you have any ideas or if this doesn't make sense or is not possible.