Monitor column for duplicate rail car numbers?

n2lectual

Board Regular
Joined
Mar 18, 2008
Messages
80
I need to monitor a column to keep from entering a rail car number I have already entered.

Worksheet1 I15 Here I enter a car number ACFX 45000

Worksheet2 D17:D117 I have a list of entries already posted.

When I enter the number in WS1 cell I15 and push Enter on the keyboard, I would like to have Worksheet1 cell I16 return a statement like "This car number is a duplicate"
OR
have a pop up say "Duplicate number, try again, click okay to continue"

Can this be done? and how? Thanks
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Paste the following into the sheet module of Sheet1...

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$I$15" Then Exit Sub

If WorksheetFunction.CountIf(Sheets("Sheet2").Range("D17:D117"), Target.Value) Then MsgBox "Duplicate number, try again, click ok to continue", vbInformation, "Uh oh!!"


End Sub
 
Upvote 0

Forum statistics

Threads
1,214,984
Messages
6,122,601
Members
449,089
Latest member
Motoracer88

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