ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I prevent duplication of numbers in a column (https://www.excelbanter.com/excel-discussion-misc-queries/75352-how-do-i-prevent-duplication-numbers-column.html)

waldo

How do I prevent duplication of numbers in a column
 
I am entering numbers in a column and it is important that I get alerted to
any duplication of a previous number. How do I do this?

Don Guillett

How do I prevent duplication of numbers in a column
 
right click sheet tabview codeinsert thismodify for your columnSAVE

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 2 Then Exit Sub
If Application.CountIf(Columns(2), Target) 1 Then MsgBox "Dup"
End Sub


--
Don Guillett
SalesAid Software

"waldo" wrote in message
...
I am entering numbers in a column and it is important that I get alerted to
any duplication of a previous number. How do I do this?




Debra Dalgleish

How do I prevent duplication of numbers in a column
 
Chip Pearson has instructions for using Data Validation to prevent
duplicate entries:

http://www.cpearson.com/excel/NoDupEntry.htm

waldo wrote:
I am entering numbers in a column and it is important that I get alerted to
any duplication of a previous number. How do I do this?



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



All times are GMT +1. The time now is 05:42 AM.

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