Dear all,
I would like to bypass Worksheet_Change when a checkbox is unticked.
I wrote the following code but the Worksheet_Change keeps firing no matter what
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo enableEventsOn:
Application.EnableEvents = False
If Not Intersect(Target, Range("R4:S40")) Is Nothing Then
Call macro_X
Active.Sheet.Range("S3").Value = "TRUE"
Application.EnableEvents = True
On Error GoTo 0
End If
End Sub
The checkbox is linked to cell S3 and when it is ticked S3 = TRUE
I would like the Worksheet_Change to stop firing when the checkbox is unticked (S3 = FALSE)
Any help is greatly appreciated.
Best,
Silvano
I would like to bypass Worksheet_Change when a checkbox is unticked.
I wrote the following code but the Worksheet_Change keeps firing no matter what
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo enableEventsOn:
Application.EnableEvents = False
If Not Intersect(Target, Range("R4:S40")) Is Nothing Then
Call macro_X
Active.Sheet.Range("S3").Value = "TRUE"
Application.EnableEvents = True
On Error GoTo 0
End If
End Sub
The checkbox is linked to cell S3 and when it is ticked S3 = TRUE
I would like the Worksheet_Change to stop firing when the checkbox is unticked (S3 = FALSE)
Any help is greatly appreciated.
Best,
Silvano