Remove ability to cut and paste from a spreadsheet

bdschleich

Board Regular
Joined
Apr 26, 2005
Messages
133
I have a spreadsheet template that I need other people to be able to type it, but I want to restrict the ability to cut and paste (still need to be able to type in those cells though, so I can't completely lock the cell). Any thoughts? Thanks!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Try in the ThisWorkbook module

Code:
Private Sub Workbook_Open()

'Clear the clipboard
Application.CutCopyMode = False

'Disable CTRL + C etc.
Application.OnKey "^{c}", "" 'Copy
Application.OnKey "^{v}", "" 'Paste
Application.OnKey "^{x}", "" 'Cut

'If the itemns below are already disabled, ignore errors
On Error Resume Next

'Disable right click menu items
ShortcutMenus(xlWorksheetCell).MenuItems("Cut").Delete
ShortcutMenus(xlWorksheetCell).MenuItems("Copy").Delete
ShortcutMenus(xlWorksheetCell).MenuItems("Paste").Delete
ShortcutMenus(xlWorksheetCell).MenuItems("Paste Special...").Delete

'Disable items on the Edit menu
With CommandBars("Worksheet Menu Bar")
    With .Controls("Edit")
        .Controls("Cut").Enabled = False
        .Controls("Copy").Enabled = False
        .Controls("Paste").Enabled = False
        .Controls("Paste Special...").Enabled = False
    End With
End With

'Reset error handling to default
On Error GoTo 0
End Sub


Private Sub Workbook_BeforeClose(Cancel As Boolean)
With CommandBars("Worksheet Menu Bar")
    With .Controls("Edit")
        .Controls("Cut").Enabled = True
        .Controls("Copy").Enabled = True
        .Controls("Paste").Enabled = True
        .Controls("Paste Special...").Enabled = True
    End With
End With
End Sub
 
Upvote 0
Try in the ThisWorkbook module

Code:
Private Sub Workbook_Open()

'Clear the clipboard
Application.CutCopyMode = False

'Disable CTRL + C etc.
Application.OnKey "^{c}", "" 'Copy
Application.OnKey "^{v}", "" 'Paste
Application.OnKey "^{x}", "" 'Cut

'If the itemns below are already disabled, ignore errors
On Error Resume Next

'Disable right click menu items
ShortcutMenus(xlWorksheetCell).MenuItems("Cut").Delete
ShortcutMenus(xlWorksheetCell).MenuItems("Copy").Delete
ShortcutMenus(xlWorksheetCell).MenuItems("Paste").Delete
ShortcutMenus(xlWorksheetCell).MenuItems("Paste Special...").Delete

'Disable items on the Edit menu
With CommandBars("Worksheet Menu Bar")
    With .Controls("Edit")
        .Controls("Cut").Enabled = False
        .Controls("Copy").Enabled = False
        .Controls("Paste").Enabled = False
        .Controls("Paste Special...").Enabled = False
    End With
End With

'Reset error handling to default
On Error GoTo 0
End Sub


Private Sub Workbook_BeforeClose(Cancel As Boolean)
With CommandBars("Worksheet Menu Bar")
    With .Controls("Edit")
        .Controls("Cut").Enabled = True
        .Controls("Copy").Enabled = True
        .Controls("Paste").Enabled = True
        .Controls("Paste Special...").Enabled = True
    End With
End With
End Sub


Can I use this to disable cut/paste but still allow copy/paste?
 
Upvote 0

Forum statistics

Threads
1,224,534
Messages
6,179,390
Members
452,909
Latest member
VickiS

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