<TABLE style="BORDER-BOTTOM: rgb(228,237,246) 1px solid; BORDER-LEFT: rgb(228,237,246) 1px solid; WIDTH: 98%; BORDER-TOP: rgb(228,237,246) 1px solid; BORDER-RIGHT: rgb(228,237,246) 1px solid" cellSpacing=0 align=center><TBODY><TR><TD>
</TD></TR><TR><TD></TD></TR><TR><TD style="BACKGROUND: rgb(228,237,246)"></TD></TR></TBODY></TABLE>
The following code will disable copy/paste from both the short cut keys and ribbon. It includes a message box to notify the user that right click has been disabled. I would like to know how to add code to include a message box to notify the user that cut/copy has been disabled when the shortcut keys (control x/control c) are used. I have tried various things, but am not skilled in this area. Thank you!
Private Sub Workbook_Activate()
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub
Private Sub Workbook_Deactivate()
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub
Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Cancel = True
MsgBox "Right click menu deactivated." & vbCrLf & _
"Cannot copy or ''drag & drop''.", 16, "For this workbook:"
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Application.CutCopyMode = False
End Sub <!-- / message --><!-- sig --><!-- / message --><!-- sig -->
</TD></TR><TR><TD></TD></TR><TR><TD style="BACKGROUND: rgb(228,237,246)"></TD></TR></TBODY></TABLE>
The following code will disable copy/paste from both the short cut keys and ribbon. It includes a message box to notify the user that right click has been disabled. I would like to know how to add code to include a message box to notify the user that cut/copy has been disabled when the shortcut keys (control x/control c) are used. I have tried various things, but am not skilled in this area. Thank you!
Private Sub Workbook_Activate()
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub
Private Sub Workbook_Deactivate()
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub
Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Cancel = True
MsgBox "Right click menu deactivated." & vbCrLf & _
"Cannot copy or ''drag & drop''.", 16, "For this workbook:"
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Application.CutCopyMode = False
End Sub <!-- / message --><!-- sig --><!-- / message --><!-- sig -->
Last edited: