PDA

View Full Version : Solver VBA code for different objective function cells



pedrostur
04-07-2016, 09:01 AM
Greetings,

I wanted to know how can I create a button that allows me to click it multiple times while the process is changing the objective cell as I click it.

To illustrate:
Changing Cells are always in :$D$2:$G$3
Max Target Cell: T118:T309
The goal is to click the 1st time in the button and the solver will maximize cell T118. By clicking the button a second time, the solver will maximize the cell T119 and so on.

Hope this is possible as this would really help my work. Thanks for your attention and time.

Pedro

Bob Phillips
04-08-2016, 04:05 AM
Set a static variable in the code and if it is nothing, set it to range(T118), otherwise increment it one cell down.

Knother
08-29-2016, 11:59 AM
Greetings,

I wanted to know how can I create a button that allows me to click it multiple times while the process is changing the objective cell as I click it.

To illustrate:
Changing Cells are always in :$D$2:$G$3
Max Target Cell: T118:T309
The goal is to click the 1st time in the button and the solver will maximize cell T118. By clicking the button a second time, the solver will maximize the cell T119 and so on.

Hope this is possible as this would really help my work. Thanks for your attention and time.

Pedro



try to create a variable code. if there is still nothing happens then a programmer that knows well on this craft is all you need. i am also curious on how to make that happen so i can also try it.