jmstarbuck
Programmer
Hi all,
I'm very new to the Excel macro world and I have encountered a problem with losing the ability to undo.
My code runs under the SheetChange event.
I think that I have to Disable Events, because I was looping when I didn't.
I've played with various Protect options to no avail.
Thoughts?
Best,
J
I'm very new to the Excel macro world and I have encountered a problem with losing the ability to undo.
My code runs under the SheetChange event.
Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Application.EnableEvents = False
ActiveSheet.Unprotect
'lots of following
If IsEmpty(ActiveSheet.Cells(Target.Row, 19)) Then
ActiveSheet.Cells(Target.Row, "S").Value = "FALSE"
End If
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowInsertingRows:=True, AllowFormattingRows:=True
Application.EnableEvents = True
End Sub
I've played with various Protect options to no avail.
Thoughts?
Best,
J