Sounds like a linear programming model ?
However keeping it simple, and I am making a few assumptions here.
You need a start and increment values to be entered, lets say cells L6 =
start value and L7 = incremental value
Add a formula to set up a stooping value from the control range M10, N10 and
L13 to P13 do not exceed 100, I will assume this is added in L8
The formula needs to show 1 if all the values are <100 and 0 otherwise 0
in Cell L8 put:
=IF(AND(MAX(M10:N10,L13:P13)<100,MIN(M10:N10,L13:P 13)0),1,0)
Code you require to run
Sub TestModel()
With Sheets("Sheet1")
' set start up value in L9
.Range("L9") = .Range("L6")
' increment value until stopping condition is meet
Do While .Range("L8") = 1
.Range("L9") = .Range("L9") + .Range("L7")
Loop
End With
End Sub
As I said this is very basic and you may need to put in forced stopping
values etc.
--
Regards,
Nigel
"BABs" wrote in message
...
I have a sheet that does numerous calculations that all hinge off of one
cell
(L9). Currently, after I enter in the test data, I manually change the
number in L9 until I get the maximum value in the production field (R13).
While changing the value in L9, I have to pay attention to the values in
cells M10 and N10 to make sure they aren't 100, and that cells L13 thru
P13
aren't 100 or <0.
How can I code a button or macro to run a range of values for L9 to find
the
max value for R13 where M10 and N10 are <100 and cells L13 thru P13 are
<100
and 0?
Thx in adv.