Using Goal Seek on a userform with variables

bugatti79

Board Regular
Joined
Feb 18, 2012
Messages
70
Folks,

I have found the following code in help file regarding the goal seek function
Code:
Worksheets("Sheet1").Range("Polynomial").GoalSeek _
<code>    Goal:=15, _    ChangingCell:=Worksheets("Sheet1").Range("X")

Is it possible to modify this such that I can use variables? For example, the variables are 'left term', 'right term' and 'sigma max'

I want to set the value of the following equation 'left term - right term' to 0 by changing variable 'sigma max'
Everything is done on the userform and not in the spreadsheet.

(Note: In spreadsheet format, the above query is equivalent to setting a cell which has a formula to 0 by changing the value in another cell, fairly simple)

Any ideas?

Thanks


</code>
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
The GoalSeek method applies to a Range and expects a Range as its second argument. So the answer is no, unless your variables are Range objects.
 
Upvote 0

Forum statistics

Threads
1,203,668
Messages
6,056,653
Members
444,880
Latest member
Kinger1968

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