Check if number already are in the sheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
Can some one help me
I need a code where i can write a number
maybe in a inputbox then the code shall see if the number i write already
are in the row, if Not write the number in the activecell , and if the are
there
error by msgbox or something like that

Hope some one can help
 
You don't need a macro. You can use validation... Try this. Highlite column A
(A1 should be the active cell). Select Data|Format ->Custom and add this
formula

=COUNTIF(A:A, A1) =1

Now try adding values into column A. It should not allow duplicates...
 
Thanks

Alvin


"Jim Thomlinson" skrev:
You don't need a macro. You can use validation... Try this. Highlite column A
(A1 should be the active cell). Select Data|Format ->Custom and add this
formula

=COUNTIF(A:A, A1) =1

Now try adding values into column A. It should not allow duplicates...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top