Macro to Automate Goal Seek in Multiple Sheets

Dan12345

New Member
Joined
Jan 7, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi there,

I have a workbook consisting of three sheets. Sheets 2 and 3 are dependent on the values input into sheet 1. I am trying to develop a macro to automate goal seek in sheet 3 to find a value which I can then copy back over to sheet 2. This is the code I am using just now, obtained from an earlier post in this forum:

Private Sub Worksheet_Change(ByVal Target As Range)
Range("O23").GoalSeek Goal:=Range("O24"), ChangingCell:=Range("O26")
End Sub

I copied my goal seek target over from sheet 2 to sheet 3 and the code is working successfully in sheet 3. However, after changing the inputs in sheet 1 (which will then change the goal seek target as intended), the goal seek calculated cell in sheet 3 is not changing until I manually go into the sheet itself and click a cell.

Sorry if I haven't explained this well, I'm new to using macros in excel.
 

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.

Forum statistics

Threads
1,215,730
Messages
6,126,528
Members
449,316
Latest member
sravya

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