Sub Scan_Barcode()
Dim BarCode As Variant
Dim rngScan As Range, FoundBar As Range
Dim BarCount As Long
Set rngScan = Range("B1:I4000")
Do
BarCode = InputBox("Scan Barcode", "Scan")
If Len(BarCode) > 0 Then
If IsNumeric(BarCode) Then BarCode = Val(BarCode)
BarCount = Application.CountIf(rngScan, BarCode)
If BarCount = 1 Then
Set FoundBar = rngScan.Find(BarCode, LookIn:=xlValues, lookat:=xlWhole, MatchCase:=False)
If Not FoundBar Is Nothing Then FoundBar.Interior.Color = rgbYellow
ElseIf BarCount > 1 Then
MsgBox "Barcode: " & BarCode & Chr(10) & "There Are " & BarCount & " Duplicates Of This Barcode", 48, "Duplicates"
Else
MsgBox "Barcode: " & BarCode & Chr(10) & "No matching barcode found!", 64, "No Matches"
End If
End If
''cancel pressed
Loop Until StrPtr(BarCode) = 0
End Sub