Is it possible to perform a goal seek in excel when the value is caluculated by a macro

spurs

Active Member
Joined
Oct 18, 2006
Messages
479
Office Version
  1. 2016
  2. 2013
  3. 2010
  4. 2007
  5. 2003 or older
Platform
  1. Windows
I use goal seek frequently and i noticed that if a function is used in a cell the goal seek works but if calculated by a subroutine it cannot

Is there a way to calculate via goal seek a value calculated through a subroutine?
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Yes, there is a way to use Goal Seek to calculate a value calculated through a subroutine. You can create a VBA subroutine to run Goal Seek anytime there is a change on a worksheet. Alternatively, you can also enable iterative calculations in Excel Options. This will allow Excel to handle circular references, or cell formulas that refer to their own result as an input to the cell formula. However, you need to set the maximum number of iterations and the maximum change (accuracy) appropriately to avoid a very long iterative loop.
 
Upvote 0
Yes, there is a way to use Goal Seek to calculate a value calculated through a subroutine. You can create a VBA subroutine to run Goal Seek anytime there is a change on a worksheet. Alternatively, you can also enable iterative calculations in Excel Options. This will allow Excel to handle circular references, or cell formulas that refer to their own result as an input to the cell formula. However, you need to set the maximum number of iterations and the maximum change (accuracy) appropriately to avoid a very long iterative loop.
Are you saying that the vba code I need to create would goal seak inside my code as opposed to use the built in excel method?
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,112
Members
453,021
Latest member
Justyna P

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