Hiya,
I'm trying to monitor the contents of a cell. If the cell gets a value of "Y" or 1 then I want to execute a Sub. I've got some code which I've added to the worksheet I want to monitor, but it's not doing anything. Can somebody tell me why and how to make it execute?
At Worksheet level:
Q
I'm trying to monitor the contents of a cell. If the cell gets a value of "Y" or 1 then I want to execute a Sub. I've got some code which I've added to the worksheet I want to monitor, but it's not doing anything. Can somebody tell me why and how to make it execute?
At Worksheet level:
Code:
Private Sub Worksheet_Calculate()
Worksheet_Change Range("D5")
End Sub
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
' Level 1: Set up the event to watch a single cell.
If Target.Address = "D5" Then
' Level 2: Perform some action based on the value of the watched cell.
Select Case Target.Value
Case 1
'Insert some code to do something here!
Case 2
'etc etc
End Select
End If
End Sub
Q