Link to home
Start Free TrialLog in
Avatar of chris pike
chris pikeFlag for Canada

asked on

Barcode Scanner to Simple Excel spreadsheet to generate a trip report for 12 items.

Hi there ,
I need a simple solution to get me started on this task.
I want to scan 12 widgets that have 4 pieces of information.
Each piece is separated by a space in the scan and after the last piece there is a carriage return.

Batch#:  (which is a 8 digit number)
Lot #:  which is one letter and 4 numbers (  J1234  )
Date: 10OCT2015 ( DDMMMYYYY )
Widget # ( up to 500 )

On  one scan all this data populates the first active cell in excel, I would like the data to separate into each cell in next column.
Then when the last scan is complete which normally is 12 skids, but could be less, it would be sent to printer to generate a trip report.

Thanks so much.
Should be fun.
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chris pike


Thank you so much Saurabh
I have QR codes already, and I have scanners too, I just need help with how to get the scanned qr code into excel.

I know how to get it into excel but, I need help with programing excel to generate a report after I make 12 scans.

Thanks so much.
I presume the text is stuffed into a single cell value and it seems to contain line separators like CR, LF or CRLF.

I would put this macro into the workbook (into a VBA module):
Function SplitMultiline(text As String, element As Integer) As Variant

    On Error GoTo Fehler
    Dim delim As String
    delim = "#"
    If InStr(1, text, vbLf) > 0 Then delim = vbLf
    If InStr(1, text, vbCr) > 0 Then delim = vbCr
    If InStr(1, text, vbCrLf) > 0 Then delim = vbCrLf
    If delim = "#" Then GoTo Fehler
    SplitMultiline = Split(text, vbLf)(element - 1)
    GoTo Ende

    SplitMultiline = CVErr(xlErrNum)

End Function

Open in new window

It would determine the line separator and return the given element.

That way you input the into a given cell and extract the parts as you like ... given
as cell content in A1, the formula

Open in new window

(syntax may varyslightly by locale) would return
as result. Cells without a known delimiter or index out of range would return an Excel compatible error code.
When I had a simple ad-hoc scanning request, I used the Manatee barcode scanner app for Android on my Samsung tablet

This read the code that I wanted, and put it on the clipboard.

I could then Paste this into any preferred spreadsheet app on the tablet.  I used WPS Office at the time, but it would work just as well with the Android version of Excel.  I then emailed this into my work email address

If the question is more about how to split up a single string of data into the 4 areas required, that should be relatively straightforward using LEFT, MID and RIGHT functions if the data has consistent numbers of characters.

If it has varying lengths (such as if using single AND double digits for the day of the month, or month itself) for instance, you may need to use FIND to select an appropriate "marker" or delimiter character.  

Can we get an example of the raw data, and perhaps preferred results to work with?

If the question is more to do with the automated submission after 12 entries, then it's macro-related... Again, an example would be helpful.
Hi Dan,
This small project is moving right along, and I have made it over a few hurdles already.

We are using a BlueTooth wireless handled scanner. I was thinkning it would be great to have an ipad doing the scan then you could actually see a missed code or a double code on the ipad screen instead of waiting until you finish a bunch of scanning and go to the other side of the warehouse to check the computer. But at this time, we have what we have and we are moving forward with this system.

 I have been able to split the code easily using "Data Tab- Split to Columns". I am using a Macro button to split it, as I wanted to wait until all the scans were in and then split them all together. I guess if I knew how to code the VB to split it on the fly after each code, that would work, but I am not that techy. But for now this works just fine.

Now my next challenge is the next worksheet where I need excel to change where the next active cell engages after a enter key. (scan). When you hit enter the default placement of the cursor is on cell below, or one cell beside (excel prefs.). It's either or. I need excel to let do 2 cell entries side by side then the third entry to drop down.

I have attached the help files.
Thanks for your help.
Here is the location for the Question
Was a little trickier to upload a video than I thought.
Hmmm .... sounds like a task for VBA to me.

For such a scanning task I'd implement some kind of user form -  fired up i.e. with a button - that catches the text (i.e. as simulated keyboard input) to asimple text box. The user probably could inspect the caught text and click/tap a button. The form code the splits the input, and drops the parts i.e. in the last selected field, the next filed to the right and a field 7 columns right of the initial field. Afterwards it selects the field i.e. 2 rows below the last field selected and ends. Do you think of such a thing ?
Unfortunatly, We have a handheld scanner on a forklift in the warehouse scanning every single skid that comes in, and then scans the location barcode off the racking. The forklift operator does not have access to the computer that will be sitting on a desk on the other side of the warehouse.

I need Excel to be smart enough to know when it is scanning a 20 digit code and to put it into the first active cell.
I need excel to know that the smaller 7 digit code (second scan) to be placed on the same row as the first scan made with the 20 digits.

Does that kind make sense?
Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial