Help with code for Goal Seek

LSB M

New Member
Joined
Aug 17, 2012
Messages
6
Hi, I have the following code, but it doesn't work!


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Row = 15 And Target.Column = 9 Then
Range("M40").GoalSeek Goal:=0, ChangingCell:=Range("M38")
Range("M51").GoalSeek Goal:=0, ChangingCell:=Range("M49")
End If
End Sub

--
Basically I have a drop down bar in cell R15C9, everytime that cell changes, I want Goal Seek to automatically make 2 calculations, one is to change M38 so that M40=0, and the other is to change M49 so that M51=0.

Somehow the code above isn't working for me. Any idea why?

Thanks in advance for any help you can give!
 
Last edited:

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