I have the following VBA code inserted into my spreadsheet:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("c12:c45")) Is Nothing Then
With Application
.EnableEvents = False
.Undo
.EnableEvents = True
End With
End If
End Sub
The macro works excellent, except for the fact that if I delete an entire row such as row 12, and I want everything in row 12 to be deleted except for c12, it undos the entire deletion. I was wondering if there was a way to manipulate this code to only undo the actions taken on the cells c12:c45. Thank you so much in advance to anyone that wants to try and help me. I will appreciate it greatly!!!!!!!
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("c12:c45")) Is Nothing Then
With Application
.EnableEvents = False
.Undo
.EnableEvents = True
End With
End If
End Sub
The macro works excellent, except for the fact that if I delete an entire row such as row 12, and I want everything in row 12 to be deleted except for c12, it undos the entire deletion. I was wondering if there was a way to manipulate this code to only undo the actions taken on the cells c12:c45. Thank you so much in advance to anyone that wants to try and help me. I will appreciate it greatly!!!!!!!