Hi All,
I have multiple sheets which already have certain macros running and want to ensure that a range of cells (for e.g. A33:B261) cannot be copied or cut ? i cannot use sheet protection as a method as that interrupts the functioning of existing macros...i am currently manging it with below code but this enables the data to be cut/copy and pasted in a new work book.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Locked = True Then
Application.EnableEvents = False
Application.Undo
Application.EnableEvents = True
End If
End Sub
I have multiple sheets which already have certain macros running and want to ensure that a range of cells (for e.g. A33:B261) cannot be copied or cut ? i cannot use sheet protection as a method as that interrupts the functioning of existing macros...i am currently manging it with below code but this enables the data to be cut/copy and pasted in a new work book.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Locked = True Then
Application.EnableEvents = False
Application.Undo
Application.EnableEvents = True
End If
End Sub