Copy and Cut Disabled

amox6

New Member
Joined
Sep 8, 2014
Messages
4
Hello everyone I'm sort of new to excel VBA and new to this forum, and I was wondering if someone could help. I recently copied and pasted a macro, specifically the one in this link VBA Express : Excel - Disable Cut, Copy, Paste. It disabled copy, cut, and paste on the particular workbook, but now I can't copy or cut with the right mouse click on new sheets. I can still CTRL C and CTRL X but I would much rather have the mouse ability. I have look through VBA and macros and there is nothing there, almost as if it's hidden or something.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Welcome to the forum

In a module in VBA, paste and run the following code
Code:
Sub enablecutcopy()
    Application.CommandBars("cell").Controls("copy").Enabled = True
    Application.CommandBars("cell").Controls("cut").Enabled = True
End Sub
 
Last edited:
Upvote 0
Well one more thing if you don't mind. My spreadsheet also won't let me cut or copy buttons. The code I put in for it doesn't seem to do anything.

ActiveSheet.Buttons.Add(500, 200, 150, 31.5).Select
Selection.Application.CommandBars("button").Controls("copy").Enabled = True
Selection.Application.CommandBars("button").Controls("cut").Enabled = True

Any help here?
 
Upvote 0
Are the cut and copy options also greyed out when rightclicking on a button?
 
Upvote 0
For buttons, they fall under the commandbar - shapes

So
Code:
Sub enablecutcopy()
    Application.CommandBars("shapes").Controls("copy").Enabled = True
    Application.CommandBars("shapes").Controls("cut").Enabled = True
End Sub

or better still, this should reset all right-click options to default
Code:
Sub resetcommands()
   Dim cbar As CommandBar
    For Each cbar In Application.CommandBars
        If cbar.Type = msoBarTypePopup Then
        cbar.Reset
        End If
    Next cbar
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

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
Back
Top