Prevent filing of cells

apgmin

Board Regular
Joined
Mar 1, 2010
Messages
150
Office Version
  1. 2013
Platform
  1. Windows
In column say column A
If have put a drop down list from which the values may be selected
If anyone types some thing the entry gets rejected, but if some one simply drags the value from above sells it works.
How do I prevent this and force the person to select from the drop down list
 
In fact it doesn't work for me. Any data I enter enters a loop, even when I select a data from the list. I have Excel 2007. With the adjustments I made it works for me.
 
Last edited:
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
We don't know the details, so we cannot write the code, but personally, since VBA code is being used, I would remove the Validation and implement it in code.

I agree. If we allow copy/paste, IMHO it makes no sense to create validation rules. The code could/should handle every entry.

M.
 
Upvote 0
In fact it doesn't work for me. Any data I enter enters a loop, even when I select a data from the list. I have Excel 2007. With the adjustments I made it works for me.

I found it!
Excel 2007 Power Programming with VBA by John Walkenbach (page 650)

M.
 
Upvote 0
However, it did not work for me, hopefully the result with the OP.

Dante,

I don't know why it doesn't work for you :confused:

Let me show you exactly what I did - it may not be clear what I did and we may be doing different things.

Data

[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
A
[/TD]
[TD="bgcolor: #DCE6F1"]
B
[/TD]
[TD="bgcolor: #DCE6F1"]
C
[/TD]
[TD="bgcolor: #DCE6F1"]
D
[/TD]
[TD="bgcolor: #DCE6F1"]
E
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Select​
[/TD]
[TD][/TD]
[TD]
List​
[/TD]
[TD][/TD]
[TD]
Copy/Paste​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
B​
[/TD]
[TD][/TD]
[TD]
A​
[/TD]
[TD][/TD]
[TD]
G​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
C​
[/TD]
[TD][/TD]
[TD]
B​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
C​
[/TD]
[TD][/TD]
[TD]
C​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
A​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
6
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Drop down in A2:A5 (List, Source:C2:C4)

I copy E2 (Ctrl+C) and try to paste (Ctrl+V), say, in A3; then I get the message "Invalid operation ..." and the code (post 4) Undo (doesn't allow) the paste operation.

M.
 
Last edited:
Upvote 0
Dante,

I don't know why it doesn't work for you :confused:

Let me show you exactly what I did - it may not be clear what I did and we may be doing different things.

Data

[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
A
[/TD]
[TD="bgcolor: #DCE6F1"]
B
[/TD]
[TD="bgcolor: #DCE6F1"]
C
[/TD]
[TD="bgcolor: #DCE6F1"]
D
[/TD]
[TD="bgcolor: #DCE6F1"]
E
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Select​
[/TD]
[TD][/TD]
[TD]
List​
[/TD]
[TD][/TD]
[TD]
Copy/Paste​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
B​
[/TD]
[TD][/TD]
[TD]
A​
[/TD]
[TD][/TD]
[TD]
G​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
C​
[/TD]
[TD][/TD]
[TD]
B​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
C​
[/TD]
[TD][/TD]
[TD]
C​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
A​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
6
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Drop down in A2:A5 (List, Source:C2:C4)

I copy E2 (Ctrl+C) and try to paste (Ctrl+V), say, in A3; then I get the message "Invalid operation ..." and the code (post 4) Undo (doesn't allow) the paste operation.

M.

Hi Marcelo, I don't know why it doesn't work for me either.
Copy E2 and paste in A3, the code enters a loop.
Copy C3 and paste in A3, the code enters a loop.
In A3 I select the value "A", the code enters a loop.


But if I use the code modified from post #9 everything works for me.
 
Upvote 0
This is the excel and many systems, maybe some of my office version.
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,310
Members
452,634
Latest member
cpostell

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