VBA - Restrict Users To Paste As Values Only

Lewzerrrr

Active Member
Joined
Jan 18, 2017
Messages
256
Hey,

I've been looking and haven't found a clear resolution to this but I'm sure it's possible.

I have a couple of sheets that my colleagues need to input into but they all use ctrl+v which overrides the formatting, to save time in tidying it up after, is it possible to add a code through a worksheet_change that DISABLES all pastespecials apart from values only?

Thanks,
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi Lewzerrr - You might consider something like the code below that takes whatever has already been selected and then pastes the values into the active cell.

Code:
Sub Lewzerrrr_PasteSpecial()
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
End Sub
 
Upvote 0
I can't remember where I found this - but it definitely wasn't me credit wise. I use it in one of my sheets as well

The following has to be pasted in ThisWorkbook and not a separate Module

Code:
 Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    On Error Resume Next
    Target.PasteSpecial xlPasteValues
    Application.CutCopyMode = True
End Sub
 
Upvote 0
Why don't you hook CTRL+V for those specific sheets and associate to it PasteSpecial xlPasteValues
 
Upvote 0

Forum statistics

Threads
1,226,730
Messages
6,192,711
Members
453,748
Latest member
akhtarf3

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