Prevent filing of cells

apgmin

Board Regular
Joined
Mar 1, 2010
Messages
143
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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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

A
B
C
D
E
1
Select​
List​
Copy/Paste​
2
B​
A​
G​
3
C​
B​
4
C​
C​
5
A​
6

<tbody>
</tbody>


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

A
B
C
D
E
1
Select​
List​
Copy/Paste​
2
B​
A​
G​
3
C​
B​
4
C​
C​
5
A​
6

<tbody>
</tbody>


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,215,261
Messages
6,123,948
Members
449,134
Latest member
NickWBA

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