Iterative calculation macro

Status
Not open for further replies.

beca

New Member
Joined
May 17, 2011
Messages
44
Hi there

I have an equation that requires iterative calcualtion to get the desired value. what I have done is to rearrange the equation to put all the parameters on one side, and set the equation equal to zero, and use "goal seek" function to solve for the desired parameter.

Because I have to do the same thing for about 100 rows, I recorded the process in the macro, and the code looks like as below:

Range("$F$4").GoalSeek Goal:=0, ChangingCell:=Range("$D$4")

Then I copied the above function 100 time and changed the cell reference manually in the macro for the rest of the spreadsheet. This works fine, However, when I insert rows in the spreadsheet, I have to manually update the macro as well, which is very frustrating.

Can anyone help me to fully automate the process, so that it is still able to do iterative calculations once I insert a new row.

Thank you
<!-- / message -->
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Per the forum rules, posts of a duplicate nature will be locked or deleted. You should rather bump your original thread by posting 'bump' in the body.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,224,521
Messages
6,179,278
Members
452,902
Latest member
Knuddeluff

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