+ Reply to Thread
Results 1 to 2 of 2

Scanned Barcode Data not decoding properly in IF ELSE loop

  1. #1
    Registered User
    Join Date
    03-10-2023
    Location
    Cincinnati, OH
    MS-Off Ver
    365
    Posts
    1

    Question Scanned Barcode Data not decoding properly in IF ELSE loop

    This is my first post on this forum so please excuse me if my problem description is unclear. I've been trying to teach myself VB as I work on this sheet and I have certainly exceeded my own abilities.

    I have been spending portions of my day attempting to update an Excel workbook macro to be able to take a UDI barcode scan input, decode it into a single string, parse out sections of it to be entered into a log. The barcode is found on product packaging and the decoded code strings contains a combination of the following fields: product's ID number, Serial number, Expiration date and lot number and can vary in length depending on how many fields it has. Now I must preface the next portions by stating that this is a sheet I inherited from a now former employee, so I have been having to interpret the code and then determine how to update its functionality.

    Currently the sheet is able to scan and decode barcodes into the main VB code for processing without issue but struggles at the section where it determines if the string contains a serial number, expiration date and/or a lot number. My current UDI barcodes consist of either 1) a product ID, serial number, expiration date, lot number, 2) product ID, lot number or 3) product ID, expiration date, lot number.

    Here's the problem I am running into:

    The portion of the code identifying the which of the 3 barcode configurations it is currently dealing with fails to consistently run. I currently use IF and IF Else statements with conditions that direct the code to the barcode configuration just scanned. The code seems to ignore the other IF Else statements past the initial If. In the Word file containing the code, I've highlighted this section in yellow. Instead of separating the different fields out, my output is combined. The sheet places the data in the correct columns on the log though.

    I've attached a copy of the sheet I'm currently working on (as the code is quite long) in hopes someone here can better understand what is going on. Thanks in advance for any insight.
    Last edited by MRutRocket13; 03-10-2023 at 04:31 PM.

  2. #2
    Registered User
    Join Date
    10-06-2023
    Location
    france
    MS-Off Ver
    2016
    Posts
    8

    Re: Scanned Barcode Data not decoding properly in IF ELSE loop

    Hello,
    Have you solved your problem?
    Cordially

+ 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. [SOLVED] VBA Inventory Using Barcode Scanner - That Counts if any Code Scanned
    By mohmadhabib in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2021, 04:01 AM
  2. Barcode scanner and excel data input
    By atn0168 in forum Excel General
    Replies: 2
    Last Post: 11-22-2020, 07:04 PM
  3. [SOLVED] Using a Barcode Scanner to Input Data Into Excel
    By sjftcec in forum Excel General
    Replies: 7
    Last Post: 08-29-2019, 03:28 PM
  4. Replies: 0
    Last Post: 03-17-2017, 10:52 AM
  5. Code 128 font not readable by barcode scanner
    By earvinnill in forum Excel General
    Replies: 3
    Last Post: 02-21-2017, 02:12 AM
  6. Barcode Scanner Data Input
    By mcnicolh in forum Excel General
    Replies: 5
    Last Post: 10-15-2014, 10:27 AM

Tags for this Thread

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