Goal Seek with constraint?

Tkeller

Board Regular
Joined
Jul 23, 2003
Messages
143
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I think I know the answer to this question. I have a goal seek problem, but in certain cases, the goal seeker goes nuts and starts putting in negative numbers as the input - I need to constrain the input cell to a positive number. So is I am setting cell "output" to Zero by chaning cell "input", I need to be sure that "input" is positive. Is there a way to do this in VBA?

If not, I will have to use SOLVER in VBA. If I use solver, as I know it is an addin, is there a way to be sure that every user will be able to use and what would the code be for something as simple as set "output" to by changin "input", subject to "input" >0.

thanks,
tom
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
GoalSeek doesn't support constraints.

Solver is part of the standard Excel distribution, but installation is (I recollect) optional.

The model changed in 2007 to expose more stuff, but 2003 code will work in later versions. There are many examples of automating Solver on the board.
 
Upvote 0
Thanks. I did not think Goal Seek could be configured with even a simple constraint, but thought I would ask to make my life simpler

I'll find an example using solver...
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,875
Members
452,949
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top