Disable ctrl c and ctrl v

kaywin

New Member
Joined
Nov 23, 2010
Messages
30
Please help me how to disable Ctrl+c ,ctrl+v and ctrl+x in the excel...

Thanks
Kaywin
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Why do you want to do that?
There are so many way to copy/paste (ctrl+c, menu, buttons, drag/drop, ...) that disabeling all of them it usually not a good way to approach the problem.
 
Upvote 0
Try

Code:
Sub DisableCutCopyPaste()
'Disable CTRL + C etc.
Application.OnKey "^{c}", "" 'Copy
Application.OnKey "^{v}", "" 'Paste
Application.OnKey "^{x}", "" 'Cut
End Sub
 
Upvote 0
Hi mikerickson,
We have added some data validation for many fields in the each sheet..If the user copy paste the content .. those validations are not working ... Thats y i planned to restrict copy paste.. Is there any other way to over come this problem?

Thanks
Kaywin
 
Upvote 0
You could alter the validation routine to handle multi-cell pastes. If you have an existing validation routine in the Change event that handles one cell you could put it into a structure like

Code:
If Not Application.Intersect(Target, KeyRange) is Nothing Then
    For Each OneCell in Application.Intersect(Target, KeyRange).Cells
        Rem routine for oneCell
    Next oneCell
End If
 
Upvote 0
Perhaps, in the sheet's code module.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If 0 < Application.CutCopyMode Then
        Target.Copy
    End If
End Sub
 
Upvote 0
How should i alter the validation routine to handle multi cell pastes. Kindly explain. It would be a great help for me too
 
Upvote 0
One way of altering it would be to take your existing (Change event based) validation routine and put it inside that loop structure.
 
Upvote 0
The loop structure is exhibited in post #6 using a change event to run the validation.

If users are copying data it's probably easier that way - try to work with the current rather than push against it.
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,741
Members
449,050
Latest member
excelknuckles

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