Hi,
I am a bit lost with my Solver model. Actually I want to re-run my 'Solver' model multiple times with VBA, but with one small change. I would like the 'changing cells' to keep changing every time I re-run the model.
So basically my target cell is: $O$3
I want to maximize it
Changing cells are: $O$3 and $H$2:$H$11
Constraints are:
$K$4:$K$5 <= $M$4:$M$5 and
$K$6:$K$7>= $M$6:$M$7
I know that the dollar signs are there to fix the values. But what I really want is a VBA code where the changing cells '$H$2:$H$11' keep on changing.
For instance, first a VBA code runs where changing cells are '$H$2:$H$11'
Then some changes are made in the worksheet (avoiding too many details) such that the changing are '$H$2:$H$12'
Then the VBA code for Solver is re-run
Then again additional values are added in some cells and now the changing cells are '$H$2:$H$13'
Now the VBA code for Solver is re-run again and so on.
So basically starting from H2, the last cell for that H column is incremented by 1 and then the VBA code re-runs.
Nothing else changes in the model (like constraints) because they are set up in that way already. But I don't know how to do that with changing cells for column H only.
Any help will be greatly appreciated! Thanks in advance!
I am a bit lost with my Solver model. Actually I want to re-run my 'Solver' model multiple times with VBA, but with one small change. I would like the 'changing cells' to keep changing every time I re-run the model.
So basically my target cell is: $O$3
I want to maximize it
Changing cells are: $O$3 and $H$2:$H$11
Constraints are:
$K$4:$K$5 <= $M$4:$M$5 and
$K$6:$K$7>= $M$6:$M$7
I know that the dollar signs are there to fix the values. But what I really want is a VBA code where the changing cells '$H$2:$H$11' keep on changing.
For instance, first a VBA code runs where changing cells are '$H$2:$H$11'
Then some changes are made in the worksheet (avoiding too many details) such that the changing are '$H$2:$H$12'
Then the VBA code for Solver is re-run
Then again additional values are added in some cells and now the changing cells are '$H$2:$H$13'
Now the VBA code for Solver is re-run again and so on.
So basically starting from H2, the last cell for that H column is incremented by 1 and then the VBA code re-runs.
Nothing else changes in the model (like constraints) because they are set up in that way already. But I don't know how to do that with changing cells for column H only.
Any help will be greatly appreciated! Thanks in advance!