Need to find a match

  • Thread starter Thread starter adamkane
  • Start date Start date
A

adamkane

Not sure how to explain, but here goes. I am getting some barcoding
software to track the shipmaent of some products. When I receive the
products they come with an Excel speadsheet that contains information
about the person(s) they are going to. Each product will have a Barcode
with a number imbedded in it that is already present in the Excel
Spreadsheet. I'm looking for a way for the number in the barcode to
find it's matching barcode in the Excel spreadsheet and populate in a
determined cell on the same row.

Example

798556 Mr. John Doe 3200 Phillip Lake Dr. Northport AL 35406 798556


The first number "798856" is already present. The second "798556" has
been scanned and inputted. I need the second one, when scanned to find
it's match and populate a cell on the same row. Is this possible to do
in Excel?

ANy help would be great!

Thanks!
:) :) :) :) :)
 
Dim rng as Range
Dim res as Variant
Dim BarCodeNumber as Long
With Worksheets("Data")
set rng = .range(.Range("A1'),.Range("A1").End(xldown))
End with
res = application.Match(BarCodeNumber,rng,0)
if not iserror res then
set rng1 = rng(res)
' rng1.offset(0,5) = "Yes"
else
msgbox BarCodeNumber & " was not found"
end if

Make sure that BarCodeNumber is typed the same as the numbers are stored in
Excel, because the string "123" does not match the number 123.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top