I've read many threads on this topic, but the code I have found there doesn't seem to work. I am trying to disable the "cut" function from an excel spreadsheet and I would like the icon to grey out.
I have been using this code:
Sub WorkSheet_Activate()
Application.CommandBars.FindControl(ID:=21).Enabled = False
End Sub
However, I can still use the "cut" function without any problem.... Also I know there are some functions that allow you to disable cut/copy/paste, but I still want copy and paste to be allowed in this spreadsheet.
Thanks in advance for your help!
Kristen
In the workbook you need to disable the cut, copy and paste functions, please press the Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window. 3.
Check the link for the reference - Disable Cut
Try something like this:
Option Explicit
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
Select Case Application.CutCopyMode
Case Is = False
'do nothing
Case Is = xlCopy
'do nothing
Case Is = xlCut
MsgBox "Please DO NOT Cut and Paste. Use Copy and Paste; then delete the source."
Application.CutCopyMode = False 'clear clipboard and cancel cut
End Select
End Sub
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With