Thread: [Solved] Protection in Excel
View Single Post
 
Old 02-28-2013, 06:56 AM
gbaker gbaker is offline Windows 7 32bit Office 2010 32bit
Competent Performer
 
Join Date: May 2012
Posts: 111
gbaker is on a distinguished road
Default Protection in Excel

Hi Tony,
I did protect cells that I didn't want anyone to be able to edit. These are cells that need to be edited but I don't want anyone to be able to cut & paste, Just copy and paste so I won't have reference issues on other sheets that are in the background. I found code that seems to work well for what I am trying to do.

Code:
Option Explicit
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
Select Case Application.CutCopyMode
Case Is = False
'do nothing
Case Is = xlCopy
'do nothing
Case Is = xlCut
MsgBox "Please DO NOT Cut and Paste. Use Copy and Paste; then delete the source."
Application.CutCopyMode = False 'clear clipboard and cancel cut
End Select
End Sub
Thanks for your help!!!
Reply With Quote