View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default disable copy paste

That is nice code. I have used similar. The problem that I ran into was
things being pasted in from applications other than excel, or where the users
where dragging or filling down. Any easy fix for those?

"Jake Marx" wrote:

Hi Tim,

Tim wrote:
How do I disable the copy paste feature?


You could try disabling all the places copy/cut/paste appear in the menus
(including context menus), but you'd still have to deal with other ways
people can copy/paste (Ctrl+c, Ctrl+x, Ctrl+v, etc). So maybe the easiest
way is to put the following code behind the Worksheet(s) you wish to disable
pasting:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.CutCopyMode = False
End Sub

This will allow the user to copy or cut, but every time the selection is
changed to a new cell or range, the clipboard will be cleared.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]