VBA Code for Automatic Goal Seek

Bkisley

Board Regular
Joined
Jan 5, 2017
Messages
100
Hello everyone, first time poster here. I have been trying to figure out how to write a VBA code that will tell Excel to run a goal seek in the background every time a value on my template I created changes. Please bare with the "random" cell locations as this is a custom template.

I need a goal seek to run every single time the value in cell F1 does not equal zero. When this cell equals zero, that means my numbers tie, if it does not then I need to create a "plug value" to make that value in F1 equal zero. The cell that needs to change is cell D21.

When doing a manual goal seek here is the set up
Set Cell: F1
To value: 0
By changing cell: D21

An alternative solution would be to automatically adjust cell D21 on a tab called Financial every time cell D42 on that same tab does not equal cell K52 on a separate tab named ROCE so that D42 on the financial tab = K52 on the ROCE tab. Cell D21 is the plug in the equation to get a value in D42.

Please please please help me stop this headache of mine!
Thank you very much in advance
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,214,942
Messages
6,122,367
Members
449,080
Latest member
Armadillos

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