Goal seek VBA with embedded IF statements

guyza

New Member
Joined
Aug 29, 2013
Messages
4
I am trying to run an automatic goal seek via a button and am not sure what the Macro VBA code should be. The forumla should ideally auto calculate (without having to press the button if possible).

The calculation is to determine an initial loan repayment amount (cell I10).
Depending on the term of the loan (cell d7 [measured in months) the cell to be modified will change (column M).

Essentially for every year the cell reference in column M increases by 12.
i.e. for 12 months = M32, 24 month = M44.....for 84 months=M104

All information is based in worksheet 'Rental Schedule (2)'

if d7 = 36 then goal seek cell M56 to equal zero by changing cell i10
if d7 = 48 then goal seek cell M68 to equal zero by changing cell i10
if d7 = 60 then goal seek cell M80 to equal zero by changing cell i10
if d7 = 72 then goal seek cell M92 to equal zero by changing cell i10
if d7 = 84 then goal seek cell M104 to equal zero by changing cell i10

Please help.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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