+ Reply to Thread
Results 1 to 5 of 5

separate scanned barcode data into different textboxes in userform

  1. #1
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    separate scanned barcode data into different textboxes in userform

    Hi, I have a userform for users to input data via a barcode scanner. There is this barcode which I would like to separate into 3 textboxes, and the information in the barcode looks like this: #03-106,A,1
    I want to split the data into Combobox1: #03-106, Combobox2: A, Combobox3: 1

    Can anyone help me with this?

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: separate scanned barcode data into different textboxes in userform

    A little confused. You refer to three textboxes and three comboboxes.

    With the code below, If you scan the bar code in TextBox1, the code will automatically split it into TextBox1, TextBox2, and TextBox3.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: separate scanned barcode data into different textboxes in userform

    Hi Alphafrog, thanks for the reply. My mistake, sorry about that, it should be comboboxes. Would it work the same if its comboboxes? I tried changing the codes to comboboxes, and the result I got was Combobox1: #03-1061, Combobox2:A, Combobox3: empty

    Did I do something wrong?

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: separate scanned barcode data into different textboxes in userform

    It might not work with a bar code scanner. I don't have one to test with.

    As a test, can you copy the text #03-106,A,1 then select Combobox1 and paste it (Ctrl+V)

    If that works and the scanner doesn't, we'll have to figure something else out.

    It should work if you put the code in a command button instead of the Combobox1_Change event, or maybe put it in the Combobox1_Exit event.

    This would split the scanner text when you exit the combobox.

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 02-15-2017 at 10:33 PM.

  5. #5
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: separate scanned barcode data into different textboxes in userform

    Thanks Alphafrog! it's working now.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 08-24-2022, 12:27 AM
  2. Replies: 1
    Last Post: 07-10-2015, 03:15 PM
  3. Barcodes sometimes cant be bleeped/scanned using barcode gun
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-15-2015, 09:09 AM
  4. Update spreadsheet when a barcode is scanned
    By fuzzyexcel in forum Excel General
    Replies: 0
    Last Post: 11-06-2014, 04:51 PM
  5. Need to copy 9 cells to another worksheet when barcode is scanned
    By MOMO7 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-03-2014, 05:00 AM
  6. Adding Date in Column When Barcode is Scanned
    By zwarner in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2013, 10:59 PM
  7. Switch worksheet depending on barcode scanned?
    By Mattneedshelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-11-2013, 06:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1