Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Can anybody help, I have been looking for some VBA code that will disable just the CUT feature of excel - allowing all other functions like COPY & PASTE still to work as normal. Several codes I have found disables the CUT, and also disables the COPY & PASTE from working as well. Does anybody know of some VBA that will also stop only the CUT used either from the keyboard CTRL+X, or from menu's in the toolbar. Thanks -- sparx ------------------------------------------------------------------------ sparx's Profile: http://www.excelforum.com/member.php...o&userid=16787 View this thread: http://www.excelforum.com/showthread...hreadid=536703 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
try
http://www.ozgrid.com/VBA/disable-cut-copy.htm Delordson Kallon http://www.instantsoftwaretraining.com/ "sparx" wrote: Can anybody help, I have been looking for some VBA code that will disable just the CUT feature of excel - allowing all other functions like COPY & PASTE still to work as normal. Several codes I have found disables the CUT, and also disables the COPY & PASTE from working as well. Does anybody know of some VBA that will also stop only the CUT used either from the keyboard CTRL+X, or from menu's in the toolbar. Thanks -- sparx ------------------------------------------------------------------------ sparx's Profile: http://www.excelforum.com/member.php...o&userid=16787 View this thread: http://www.excelforum.com/showthread...hreadid=536703 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Thanks for your direction - I have tried those sites and they provide VBA that stops all the copy, cut, paste etc working, I only want to stop the CUT from working by either keyboard shortcut or menu options - I did though find this code and altered it and it did sort of work but not properly - so can anybody help with the following - -- Worksheet_Activate Event -- Sub DisableCutCopy() On Error Resume Next With Application 'disables shortcut keys .OnKey "^c", "" .OnKey "^v", "" .OnKey "^x", "" 'Disables Copy .CommandBars("Edit").FindControl(Id:=19).Enabled = False .CommandBars("Edit").FindControl(Id:=848).Enabled = False .CommandBars("Cell").FindControl(Id:=19).Enabled = False .CommandBars("Column").FindControl(Id:=19).Enabled = False .CommandBars("Row").FindControl(Id:=19).Enabled = False .CommandBars("Button").FindControl(Id:=19).Enabled = False .CommandBars("Formula Bar").FindControl(Id:=19).Enabled = False .CommandBars("Worksheet Menu Bar").FindControl(Id:=19).Enabled = False .CommandBars("Standard").FindControl(Id:=19).Enabl ed = False .CommandBars("Button").FindControl(Id:=848).Enable d = False .CommandBars("Formula Bar").FindControl(Id:=848).Enabled = False .CommandBars("Worksheet Menu Bar").FindControl(Id:=848).Enabled = False .CommandBars("Standard").FindControl(Id:=848).Enab led = False .CommandBars("Ply").FindControl(Id:=848).Enabled = False 'Disables Cut .CommandBars("Edit").FindControl(Id:=21).Enabled = False .CommandBars("Cell").FindControl(Id:=21).Enabled = False .CommandBars("Column").FindControl(Id:=21).Enabled = False .CommandBars("Row").FindControl(Id:=21).Enabled = False .CommandBars("Button").FindControl(Id:=21).Enabled = False .CommandBars("Formula Bar").FindControl(Id:=21).Enabled = False .CommandBars("Worksheet Menu Bar").FindControl(Id:=21).Enabled = False .CommandBars("Standard").FindControl(Id:=21).Enabl ed = False End With End Sub -- Worksheet_Deactivate Event -- Sub EnableCutCopy() On Error Resume Next With Application .OnKey "^c" .OnKey "^v" .OnKey "^x" 'Enables Copy .CommandBars("Edit").FindControl(Id:=19).Enabled = True .CommandBars("Edit").FindControl(Id:=848).Enabled = True .CommandBars("Cell").FindControl(Id:=19).Enabled = True .CommandBars("Column").FindControl(Id:=19).Enabled = True .CommandBars("Row").FindControl(Id:=19).Enabled = True .CommandBars("Button").FindControl(Id:=19).Enabled = True .CommandBars("Formula Bar").FindControl(Id:=19).Enabled = True .CommandBars("Worksheet Menu Bar").FindControl(Id:=19).Enabled = True .CommandBars("Standard").FindControl(Id:=19).Enabl ed = True .CommandBars("Button").FindControl(Id:=848).Enable d = True .CommandBars("Formula Bar").FindControl(Id:=848).Enabled = True .CommandBars("Worksheet Menu Bar").FindControl(Id:=848).Enabled = True .CommandBars("Standard").FindControl(Id:=848).Enab led = True .CommandBars("Ply").FindControl(Id:=848).Enabled = True ' Enables Cut .CommandBars("Edit").FindControl(Id:=21).Enabled = True .CommandBars("Cell").FindControl(Id:=21).Enabled = True .CommandBars("Column").FindControl(Id:=21).Enabled = True .CommandBars("Row").FindControl(Id:=21).Enabled = True .CommandBars("Button").FindControl(Id:=21).Enabled = True .CommandBars("Formula Bar").FindControl(Id:=21).Enabled = True .CommandBars("Worksheet Menu Bar").FindControl(Id:=21).Enabled = True .CommandBars("Standard").FindControl(Id:=21).Enabl ed = True End With End Sub I removed all the code that didnt relate to the CUT option ( I believe is 21 ) and put this into the "ThisWorkbook" of an Excel file - but for some reason it still let me cut - where am I going wrong? -- sparx ------------------------------------------------------------------------ sparx's Profile: http://www.excelforum.com/member.php...o&userid=16787 View this thread: http://www.excelforum.com/showthread...hreadid=536703 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Disable Query Refresh warning dialog box in Excel 2003 | Excel Discussion (Misc queries) | |||
Disable Customize toolber tabs | Excel Discussion (Misc queries) | |||
Disable resize Waterfall chart | Charts and Charting in Excel | |||
allow user to disable annoying warning dialog on log charts | Charts and Charting in Excel | |||
Disable Adding & Deleting Rows/Columns | Excel Discussion (Misc queries) |