Worksheet_Change to stop people copy & pasting into two seperate rows.

ScottDavies

New Member
Joined
Mar 9, 2016
Messages
7
Hey guys,

I've read about Worksheet_Change, but I cannot get it to work.

I have Row F with Data Validation active - it requires 11 numbers to be entered
I have row G with Data Validation active - it requires a number of 7000 or above, and appears as a whole number with 2 decimal places (i.e. no currency £, $, etc)

What I want to happen is if someone pastes some data into Row F/G that does not match the Data Validation, an error message to pop up, and not allow them to paste.

I obviously also want them to be unable to manually type any data that does not stick to the Data Validation rules also, and again come up with an error message.

Can it be done?

-Scott
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
What I want to happen is if someone pastes some data into Row F/G that does not match the Data Validation, an error message to pop up, and not allow them to paste.

AFAIK, if you paste something to a cell with data validation, the data validation will be erased. I don't know how to work around that.
An idea?
Hm, you might consider using combobox instead (embedded in the sheet not in a from) , it gives you more control. But I haven't created the macro yet, still in 'trial & error' phase.
Let me know if you're interested.
 
Upvote 0

Forum statistics

Threads
1,214,824
Messages
6,121,784
Members
449,049
Latest member
greyangel23

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