Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Is it possible to disable the copy and paste function without protecting sheets. Thanks Nick -- Nick S ------------------------------------------------------------------------ Nick S's Profile: http://www.excelforum.com/member.php...o&userid=16512 View this thread: http://www.excelforum.com/showthread...hreadid=382437 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() That does the tric -- Nick ----------------------------------------------------------------------- Nick S's Profile: http://www.excelforum.com/member.php...fo&userid=1651 View this thread: http://www.excelforum.com/showthread.php?threadid=38243 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nick,
you can disable/control key shortcuts like CTRL+c etc with Application.Onkey function by e.g. checking sheetname first before allowing copying. You could assign new macro's to Cut/copy paste buttons or just add code to them using event sinking(Excel 2000 and later). Especially sinking the events of all the cut/copy/paste buttons should be considered advanced VBA. some test code: Public Sub nocopy() If ActiveSheet.Name = "Sheet1" Then MsgBox "nocopy" Else Application.CommandBars.FindControl(, 21).Execute ' execute copy button End If End Sub Sub test() Application.OnKey "^c", "nocopy" End Sub DM Unseen |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Disable copy and paste | Excel Worksheet Functions | |||
How do I disable the pop-ups that appear when I copy/paste, etc? | Excel Discussion (Misc queries) | |||
disable copy paste | Excel Programming | |||
Copy disable | Excel Programming | |||
Can I disable the copy feature? | Excel Worksheet Functions |