I recently had a question on here
The title was "Scanning barcodes and matching them to existing numbers"
Link to original post
https://www.teachexcel.com/talk/6468/scanning-barcodes-and-matching-them-to-existing-numbers#discuss_section_6468
It was answered beautifully using this code
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Fnd As Long, LstRw As Long, n As Long
' check only value of H1 changed
If Target.CountLarge <> 1 Or Intersect(Target, Range("H1")) Is Nothing Then Exit Sub
' prevent this being triggered again by itself
Application.EnableEvents = False
'find last row in column E
LstRw = Range("E" & Rows.Count).End(xlUp).Row
' loop from 2 to that row
For n = 2 To LstRw
' if value matches...
If Target.Value = Cells(n, 5).Value Then
' add a statement in column F
Cells(n, 6).Value = Target.Value & " located " & Now
' increase Found counter (from 0)
Fnd = Fnd + 1
End If
Next n
' If it wasn't found once...
If Fnd <> 1 Then
'... alert user
MsgBox "Tag #" & Target.Value & " found " & Fnd & " times in column H" & Chr(13) & "Please check / add new details in row " & LstRw
End If
' clear H1 value and reselect it (for next entry)
Target.Value = ""
Target.Select
' Allow events to work again
Application.EnableEvents = True
End Sub
Example file sheet with the code is attached.
the issue im having is that when i scan a tag # that isnt found in Columbn E a popup message appears that i have to manually clear. What i would like is for any tag # not found to be thrown in a "not found" list, Column I, for example could be a list of anything scanned and not found. this way i can just go through scanning items without being interupted and when the scan is done the missed items would be represented by an unpopulated line in Column F next to its corresponding tag # and the extra items would be listed in Column I.