Pasting into a cell with data validation

Dave Punky

Board Regular
Joined
Jan 7, 2010
Messages
133
Hi all,

I'm having a real issue in regards to being able to paste into a cell which supposedly has data validation on it.

Basically I have a cell with a dropdown which gives one of 3 options. If you try and type manually into this cell it's fine it throws up the error saying you can't do that. However if I paste into the cell it goes completely unchallenged and just sits there.

I also have the same issue with a cell which has data validation for date specific values, I can just copy text into it and it completely defeats the object of having data validation in the first place.

Is there any way of disabling paste into specific cells, so say A1 has validation on it then you can't paste into that cell, you either have to manually type in or make a selection?

Any help would be appreciated!
 
I didn't, as soon as I closed/reopened excel it worked. And I've only got it set low just while I'm doing this, it's annoying me asking to enable macros every time I open a worksheet lol.

So as we know that does actually work, what do I need to do in my sheet to replicate it as I must be doing something wrong somewhere...
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Can you follow the directions in my last post, and copy the code from the sheet module and code module?

In particular, you need to create the named range yourSheetName!rgnVal on the worksheet that identifies the validation cells.
 
Upvote 0
Ok I did exactly that, infact the code looks identical in both sheets except yours has a reference to an .xls I don't have (personal.xls?) - but it shouldn't matter anyway.

The problem I now have is that I can paste into any cell again without resistance - even on your sheet. I was worried that I'd actually deleted something by accident so I redownloaded it, closed all instances of Excel and reopened and I can paste in again. I cannot explain any reason why it would suddenly stop working like that unless theres some setting in Excel I need to re-enable. I went and ran the enable event script also provided earlier but no change.

This has to be the most frustrating thing I have ever tried to do, lol.
 
Upvote 0
Dunno. Somehow you are either disabling events or disabling macros entirely.
 
Upvote 0
It's got to be events as macros still work on the worksheet after pasting.

Is there any VBA I can stick in on opening the sheet to enable events every time its used, to somehow stop it being disabled (because I have no idea how I'm disabling it in the first place)?
 
Upvote 0
Search your code, project-wide, for EnableEvents.
 
Upvote 0
Ok the only instances I see of that are in your macro code in the normal module:

Code:
           Application.EnableEvents = False
            Application.Undo
            Application.EnableEvents = True

No other instances of it anywhere in my code.
 
Upvote 0
Is the workbook being opened programmatically from another workbook?

How are you starting Excel?

I'm running out of suggestions ... maybe Detect and Repair is next.
 
Upvote 0
OK, this is my last suggestion: Post the workbook, stripped of sensitive information, on box.net or similar and post a link.
 
Upvote 0

Forum statistics

Threads
1,223,635
Messages
6,173,479
Members
452,516
Latest member
archcalx

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