Macro to perform goalseek - help!!

mattyhigginsuk

New Member
Joined
Feb 24, 2006
Messages
16
Hi,

I have a calculator that derives a monthly payment by accounting for net capital amount (combination of total capital amount, deposit and part exchange), flat interest rate and loan period. I need to make it all singing and dancing, in particular by inserting buttons next to price, deposit,flat rate and term which will invoke a recalculation of that variable based on the changes made to any or all of the others.
I have no idea about macros and would be really grateful for any assistance offered as to how I can do this. I have used the goal seek function before but need something to automate it and that can use the contents of a cell as the goal.
Is this possible???

Thanks
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
GoalSeek is available in VBA - example from the Help

Rich (BB code):
<code>Worksheets("Sheet1").Range("Polynomial").GoalSeek _
    Goal:=15, _
    ChangingCell:=Worksheets("Sheet1").Range("X")
</code></pre>
 
Upvote 0
Thanks for your reply. Only issue I have is that the goal seek figure is a variable (the contents of one of the cells) rather than a specific number and goal seek doesn't seem to like this. Any ideas at all anyone????
 
Upvote 0
This might work.

Enter the initial value of the debt in E3, the number of periods to repay the debt in E7, and the monthly repayment value in E9.
<o:p> </o:p>
Then create the following Macro (and assign it to a button). This gives you the interest rate needed to complete the maths in E7.


Code:
Sub Interest()
  Range("A1").Formula = "=PMT(E5,E7,E3)"
  Range("A1").GoalSeek Goal:=Range("E9").Value, _
  ChangingCell:=Range("E5")
  End Sub
 
Upvote 0

Forum statistics

Threads
1,215,614
Messages
6,125,848
Members
449,266
Latest member
davinroach

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