Thread: Disable Copy
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
dominicb[_45_] dominicb[_45_] is offline
external usenet poster
 
Posts: 1
Default Disable Copy


Good afternoon Nick S

This type of request can be tricky, in that it is very easy to disabl
the menu, but there are keyboard shortcuts to consider and th
rightclcik menu to worry about, so the easiest way is to introduce
short single command macro into the ThisWorkbook that will empty th
clipboard every time an active cell changes:

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVa
Target As Range)
Application.CutCopyMode = False
End Sub

This will do the trick, by allowing a user to copy, but not paste. Ad
this and it will prevent a user pasting something outside the curren
sheet:

Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
Application.CutCopyMode = False
End Sub

The downside : this code relies on the user opting to run the macros o
the sheet opening, if they say no to the "Run macros" question the cod
will be useless.

HTH

Dominic

--
dominic
-----------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...fo&userid=1893
View this thread: http://www.excelforum.com/showthread.php?threadid=38243