ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   prevent the copy and paste function (https://www.excelbanter.com/excel-discussion-misc-queries/59306-prevent-copy-paste-function.html)

sir Lancelot

prevent the copy and paste function
 
Can users be prevented from using the copy or paste function in shared
workbooks. I have several cells in workbooks that contain data validation.
I want to prevent other users from overriding the validation. Can this be
done? The workbooks are protected and shared but the worksheets are not.

Jerry Price

prevent the copy and paste function
 


This will disable Copy / Paste, load on Workbook open:

'///
Sub DisablePaste()
EnableControl 21, False ' cut
EnableControl 19, False ' copy
EnableControl 22, False ' paste
EnableControl 755, False ' pastespecial
Application.OnKey "^c", "Message"
Application.OnKey "^v", "Message"
Application.OnKey "+{DEL}", "Message"
Application.OnKey "+{INSERT}", "Message"
Application.CellDragAndDrop = False
Application.OnDoubleClick = "Message"
CommandBars("ToolBar List").Enabled = False
End Sub
'///


Load on Workbook Close

'///
Sub EnablePaste()
EnableControl 21, True ' cut
EnableControl 19, True ' copy
EnableControl 22, True ' paste
EnableControl 755, True ' pastespecial
Application.OnKey "^c"
Application.OnKey "^v"
Application.OnKey "+{DEL}"
Application.OnKey "+{INSERT}"
Application.CellDragAndDrop = True
Application.OnDoubleClick = ""
CommandBars("ToolBar List").Enabled = True
End Sub
'///




Sub Message()
'// NoGo
MsgBox "Sorry command not Available!" & vbCrLf & _
"Cannot Paste or ''drag & drop''.", 16, "on any Scope Sheets in this
workbook:"
End Sub





sir Lancelot wrote:

Can users be prevented from using the copy or paste function in shared
workbooks. I have several cells in workbooks that contain data validation.
I want to prevent other users from overriding the validation. Can this be
done? The workbooks are protected and shared but the worksheets are not.


--
Thanks & Regards,

Jerry


All times are GMT +1. The time now is 10:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com