For
i=1 to 50
SolverReset
SolverOptions MaxTime:=20, Iterations:=100, Precision:=1E-99, AssumeLinear:= _
False
, StepThru:=
False
, Estimates:=1, Derivatives:=1, SearchOption:=1, _
IntTolerance:=0, Scaling:=
False
, Convergence:=1E-99, AssumeNonNeg:=
False
SolverOk SetCell:=
"$C$4"
, MaxMinVal:=3, ValueOf:=
CStr
(Range(
"B4"
)), ByChange:=
"$O$2:$O$7"
SolverAdd CellRef:=
"$O$2:$O$7"
, Relation:=4, FormulaText:=
"Ganzzahlig"
SolverAdd CellRef:=
"$O$2:$O$7"
, Relation:=3, FormulaText:=
"0"
SolverAdd CellRef:=
"$O$2:$O$7"
, Relation:=1, FormulaText:=
"=1"
SolverSolve
True
If
Sheets(
"Bere"
).Range(
"D4"
).Value =
"OK"
Then
Exit
Sub
SolverReset
SolverOptions MaxTime:=20, Iterations:=100, Precision:=1E-99, AssumeLinear:= _
False
, StepThru:=
False
, Estimates:=1, Derivatives:=1, SearchOption:=1, _
IntTolerance:=0, Scaling:=
False
, Convergence:=1E-99, AssumeNonNeg:=
False
SolverOk SetCell:=
"$C$4"
, MaxMinVal:=3, ValueOf:=
CStr
(Range(
"B4"
)) - i, ByChange:=
"$O$2:$O$7"
SolverAdd CellRef:=
"$O$2:$O$7"
, Relation:=4, FormulaText:=
"Ganzzahlig"
SolverAdd CellRef:=
"$O$2:$O$7"
, Relation:=3, FormulaText:=
"0"
SolverAdd CellRef:=
"$O$2:$O$7"
, Relation:=1, FormulaText:=
"=1"
SolverSolve
True
If
Sheets(
"Bere"
).Range(
"D4"
).Value =
"OK"
Then
Exit
Sub
Next
i
End
Sub