Detect Enter Key and search value in a range

jamiguel77

Active Member
Joined
Feb 14, 2006
Messages
387
Office Version
  1. 2016
  2. 2010
  3. 2007
Platform
  1. Windows
  2. Web
Hi friends.

How to do:

the user start capture in cell A1="APPLE" go to A2 and capture "ORANGE" and then the user capture in A3="APPLE" here how to check every capture if exist say a message: "Error, captured on A1"


or only can do the task, with a button and with vba code?


thanks
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Select A1:A10 > Data validation > Custom > use this formula
=COUNTIF(A$1:A1,A1)=1
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
friend, tested the sample in a blank sheet, but when i try do same job to a cell: c5 to c1000 not work:

1) Select c5 to c1000 and follow the steps and put this formula:

=COUNTIF(C$1:C1,C1)=1




but not work, wich is wrong?


thanks
 
Upvote 0
You need to change the formula to the first cell like
=COUNTIF(C$5:C5,C5)=1
 
Upvote 0
Worked......

other dudes with this topic...

1) i configure a Stop message when user type a duplicate value, but the message not was displayed, only if user type a duplciated value, cant continue, the cursor is in same cell why not display the message but the formula work perfectly?
2) is possible coloring a cell with red, and continue capturing?
3) is possible send a personalzed message: "Error, this data: "+DATA+" was captured on cell: "
 
Upvote 0
Just a further check that you are getting what you want. With the Data Validation suggested, it would not allow you to enter "Apple" in C7 if "Apple" had already been entered in C5 or C6 however it would not stop the user going back to say C5 and entering "Orange" if "Orange" has already been entered anywhere below C5. If that is an issue for you then ..

Select C5:C1000 and use this DV formula.
=COUNTIF(C$5:C$1000,C5)=1

For the idea of stating what value is trying to be entered and where that value already occurs, you would need vba code and also ensure that any user of the sheet was allowing macros to run.
 
Upvote 0
Thanks....



i know about VBA i think seriously in type some code for get the JOB

a dude in Custom data validation can i execute my macro? and pass as parameter the cell value?


how to do? or create other topic?

thanks
 
Upvote 0
i know about VBA i think seriously in type some code for get the JOB

a dude in Custom data validation can i execute my macro? and pass as parameter the cell value?


how to do? or create other topic?
Sorry, I'm struggling to understand that - language translation problem? Perhaps you could try again & try to be more more careful with the English if you can.
 
Upvote 0

Forum statistics

Threads
1,223,155
Messages
6,170,405
Members
452,325
Latest member
BlahQz

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