Hi Celtic_Avenger,
I would like to know if there is a way to disable the Ctrl_C and Ctrl_V
shortcuts in this workbook only, but allow them to work in other open
workbooks.
Sure. You need to hook the workbook's events and disable them when one
of the workbook's windows is activated and enable them when one of the
workbook's windows is deactivated. I guess you also need to handle
Shift+Insert and Ctrl+Insert as well. Put the following in the
ThisWorkbook module:
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
'Disable when switching to us
Application.OnKey "^C", ""
Application.OnKey "^c", ""
Application.OnKey "^{INSERT}", ""
Application.OnKey "^V", ""
Application.OnKey "^v", ""
Application.OnKey "+{INSERT}", ""
End Sub
Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
'Enable when switching away
Application.OnKey "^C"
Application.OnKey "^c"
Application.OnKey "^{INSERT}"
Application.OnKey "^V"
Application.OnKey "^v"
Application.OnKey "+{INSERT}"
End Sub
Regards
Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.ie