Limit cell entry to specific text - even when copy/paste data

SirSquiddly

New Member
Joined
Jun 26, 2018
Messages
40
Hi,

My issue is this.

I have a sheet where I would like the first few columns to permit any text entry, it is various serial codes.

I would like coloumns D - P, be limited to what data can be entered.

I have made drop down boxes and ticked the box to show error alert for invalid data entry. This works well when data is input to each cell individually.

My issues is when a row is copied from another sheet and pasted into this sheet, invalid data can be entered, which I do not want. Ideally it would alert the user which cell(s) is incorrect, but would be happy if it did not allow the paste at all.

Can anyone help with this issue?

Thanks
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hello SirSquiddly

Here is some code that will turn off copy paste when the user tries to enter a designated range. You need to paste these SUBS in the SHEET level module for the sheet you want to protect. Create a named range called NoCopyRng to cover the area in Columns D-P. Try to copy some data and then paste it into a cell in one of those columns.

Code:
Private Sub Worksheet_Activate()
  Dim i As Range
  Set i = Intersect(ActiveCell, Range("NoCopyRng"))
  If Not i Is Nothing Then
    Application.CutCopyMode = False
  End If
End Sub


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  Dim i As Range
  Set i = Intersect(Target, Range("NoCopyRng"))
  If Not i Is Nothing Then
    Application.CutCopyMode = False
  End If
  
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

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