ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Check if number already are in the sheet (https://www.excelbanter.com/excel-programming/401375-check-if-number-already-sheet.html)

alvin Kuiper

Check if number already are in the sheet
 
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



Jim Thomlinson

Check if number already are in the sheet
 
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...
--
HTH...

Jim Thomlinson


"alvin Kuiper" wrote:

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



alvin Kuiper

Check if number already are in the sheet
 
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...
--
HTH...

Jim Thomlinson


"alvin Kuiper" wrote:

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




All times are GMT +1. The time now is 12:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com