Macro to Disable Cut/Paste, Allow Copy/Paste

wolverine97

New Member
Joined
Mar 16, 2010
Messages
13
I am looking for a macro to disable the cut and paste function for all sheets in a workbook, but allow copying and pasting (including copying and pasting from another workbook). Thanks in advance for any help.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Just give this a Try:
copy and paste this into thisworkbook section of your workbook.
Code:
Private Sub Workbook_Deactivate()
If ActiveWorkbook.Name = "Book1" Then
    For Each ws In ThisWorkbook.Worksheets
        Application.CutCopyMode = False
    Next
End If
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If ActiveWorkbook.Name = "Book1" Then
    For Each ws In ThisWorkbook.Worksheets
        Application.CutCopyMode = False
    Next
End If
Application.CutCopyMode = False
End Sub
*Change "Book1" to the name of your workbook that you want to disable the cut and copy/paste function
 
Last edited:
Upvote 0
Thanks for the quick reply Villy. The more I look at this though, the more complicated it's getting.
I actually need to disable cut, but allow paste; disable auto-fill; and only allow paste/special/values (or more specifically, maintain destination formatting).
This definitely gets me started though. Thank you!!
 
Upvote 0
Rich (BB code):
Private Sub Workbook_Deactivate()
If ActiveWorkbook.Name = "Book1" Then
    For Each ws In ThisWorkbook.Worksheets
        Application.CutCopyMode = False
    Next
End If
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If ActiveWorkbook.Name = "Book1" Then
    For Each ws In ThisWorkbook.Worksheets
        Application.CutCopyMode = False
    Next
End If
Application.CutCopyMode = False
End Sub
remove red
 
Upvote 0

Forum statistics

Threads
1,224,520
Messages
6,179,270
Members
452,902
Latest member
Knuddeluff

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