sameerdoda
New Member
- Joined
- Dec 22, 2016
- Messages
- 2
Hi All
I am trying to automate the goal seek function and found the following code on one of the sites. The code is supposed to run whenever any changes are made to the sheet. However, I get a "Variable Not Defined" error and C9 is highlighted.
Option Explicit
Private Sub Worksheet_Calculate()
CheckGoalSeek
End Sub
Private Sub CheckGoalSeek()
Range(“C12”).GoalSeek Goal:=0, ChangingCell:=Range(“C9”)
End Sub
I am very new to macros and any help will be really appreciated!
I am trying to automate the goal seek function and found the following code on one of the sites. The code is supposed to run whenever any changes are made to the sheet. However, I get a "Variable Not Defined" error and C9 is highlighted.
Option Explicit
Private Sub Worksheet_Calculate()
CheckGoalSeek
End Sub
Private Sub CheckGoalSeek()
Range(“C12”).GoalSeek Goal:=0, ChangingCell:=Range(“C9”)
End Sub
I am very new to macros and any help will be really appreciated!