Automatic goal seek for certain cells

Mr Chem Eng

New Member
Joined
Jun 23, 2013
Messages
3
Hi I couldn't find a similar topic for this question, so sorry if one already exists.

I am trying to do a goal seek 100 times if a certain condition is true.

The first goal seek is on cell R104, where the target value is R103 and the variable cell is Q104. The next goal seek is cell R110, target value R109 and variable cell Q110. I.e. the target cell, variable cell and goal seek cell moves 6 cells down. This needs to happen 100 time until target cell R698.

It is probably a really simple problem but I am very lost with loops. If anyone could help me that would be fantastic!

Thanks.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Edit: here is the code I have so far for this loop.

Dim i As Long

For i = 1 To 100
equation = Range("R104").Offset(6, 0).Value
variable = Range("Q104").Offset(6, 0).Value
target = Range("R103").Offset(6, 0).Value
'goal seek
equation.GoalSeek goal:=target, ChangingCell:=variable
Next¸
 
Upvote 0

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