Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable copy/paste in unlocked cells on protected sheet?

Tags:

excel

vba

Is it possible to disable copy/paste in unlocked cells on protected sheet?

My specific problem is that while users should be able to edit unlocked cells, they should not copy data validation from one cell to another. Unfortunately data validation gets copied in a normal copy/paste operation.

So is it possible to disable copy/paste in unlocked cells on protected sheet or change the behavior of data validation so that it is not affected by copy/paste?

The suggested solution can be either Excel or VBA.

like image 700
user1283776 Avatar asked Feb 12 '23 01:02

user1283776


1 Answers

try this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Application.CutCopyMode = False
End Sub

put this code inside sheet

enter image description here

like image 79
Vasily Ivoyzha Avatar answered Feb 16 '23 07:02

Vasily Ivoyzha