Using GoalSeek

Rauber

New Member
Joined
Feb 25, 2011
Messages
6
Hi guys! I've gotta know how to add restrictions when i'm using GoalSeek on VBA. For example, when i'm using Solver on the Plan to reach the value 0 for 3 cells A1, A2, A3, I put there, A1=0, and the restrictions A2=A1, and A3=A1. Good. But how to do it using GoalSeek on VBA??? Thanks
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
GoalSeek Method [VBA Help]

Calculates the values necessary to achieve a specific goal. If the goal is an amount returned by a formula, this calculates a value that, when supplied to your formula, causes the formula to return the number you want. Returns True if the goal seek is successful.

expression.GoalSeek(Goal, ChangingCell)

expression Required. An expression that returns a Range object. Must be a single cell.

Goal Required Variant. The value you want returned in this cell.

ChangingCell Required Range. Specifies which cell should be changed to achieve the target value.


Example

This example assumes that Sheet1 has a cell named "Polynomial" that contains the formula =(X^3)+(3*X^2)+6 and another cell named "X" that’s empty. The example finds a value for X so that Polynomial contains the value 15.


<CODE>
Rich (BB code):
Worksheets("Sheet1").Range("Polynomial").GoalSeek _ </CODE>
<CODE>    Goal:=15, _ </CODE>
<CODE>    ChangingCell:=Worksheets("Sheet1").Range("X")
</CODE>
</PRE>
 
Upvote 0

Forum statistics

Threads
1,224,534
Messages
6,179,391
Members
452,909
Latest member
VickiS

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