Cut and Copy Menus Disabled

Maz

New Member
Joined
Aug 22, 2006
Messages
7
Maybe I have done it in my sleep, or someone is secretly playing a trick on me but I seem to have diabled the cut and copy menus on both the toolbar and the cell menu's. There doesn't appear to be any VBA causing it but I was playing around with this stuff a few weeks ago but didn't think I had saved it...any ideas?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Maz

New Member
Joined
Aug 22, 2006
Messages
7
I did have a look at that but it was something far simpler. I'm just new to VBA so it would have been a real easy section of code, ten lines or less I'm sure!
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Try pasting this part of the code into a General module and running it:

Code:
Sub EnableCopyCutAndPaste() 
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 EnableControl(Id As Integer, Enabled As Boolean) 
Dim CB As CommandBar 
Dim C As CommandBarControl 

On Error Resume Next 
For Each CB In Application.CommandBars 
Set C = CB.FindControl(Id:=Id, recursive:=True) 
If Not C Is Nothing Then C.Enabled = Enabled 
Next 

End Sub
 

Maz

New Member
Joined
Aug 22, 2006
Messages
7
Nope, doesn't work. I can still use CTRL+X and CTRL +C but nothing else. When I look at the VB code window, all it says is Option Explicit. There doesn't appear to be anything going on, no modules there or anything and it's the same in every workbook I open. :confused:
 

Forum statistics

Threads
1,143,672
Messages
5,720,217
Members
422,270
Latest member
CaptainMurray

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top