It can't be an off/on sort of thing, I need it the commandbutton to clear certain rows without triggering worksheet_change, then allow the worksheet_change event to be immediately active again. Here's what I put in the commandbutton code:
Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
Const pw As String = "password"
Dim ce As Variant
ActiveSheet.Unprotect pw
Range("AA1").Value = "x"
For Each ce In Sheets("CONTROL").Range("S129:S228")
If ce.Value = 1 Then ActiveSheet.Cells(ce.Row - 112, "B").Resize(1, 13).ClearContents
Next ce
Application.ScreenUpdating = True
ActiveSheet.Protect pw, AllowSorting:=True, AllowFiltering:=True
End Sub
And this in the workshee_change event right in the beginning:
If Range("AA1").Value = "x" Then
Application.ScreenUpdating = False
Range("AA1").Value = ""
Application.ScreenUpdating = True
Exit Sub
End If
But it's still not quite working. Any ideas?
Bookmarks