+ Reply to Thread
Results 1 to 6 of 6

Is it possible to make barcode scan coding to auto pop up error message box when value not

  1. #1
    Registered User
    Join Date
    07-29-2015
    Location
    MY
    MS-Off Ver
    office 2010
    Posts
    15

    Is it possible to make barcode scan coding to auto pop up error message box when value not

    This is my coding and is function well, but my problem now is my current coding need to select column and compare value whether the value same or not. Now, I want to modify this coding to auto scan barcode and pop up a message box when the value is not match. Is it possible to make this changes?

    Code:
    Please Login or Register  to view this content.
    Example
    Column 1----Column 2
    123 ------------123 -pop up message - PASS
    134-------------174 -pop up message - Number not match! Please try again!


    Column 1 is for refer, column 2 is for barcode scan, if the number not match, the error message will directly pop up right after the code is scan.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Is it possible to make barcode scan coding to auto pop up error message box when value

    All a barcode scanner does is type something for you into a cell, it's a just a quick data entry tool. So setting that aside for now, it seems all you're asking is that Excel stop you if enter a value in column B that does not match the value already in column A. This can easily be done with simple Data Validation. VBA would be overkill.

    1) Make sure A2 is empty at the start of this setup
    2) Now select B2 and apply these Data > Validation settings:
    Allow: Custom
    Formula: =B2=A2
    Error Alert: [x] Show error alert after invalid data is entered
    (also fill in a useful Error Title and Error message


    That's it. Now drop in you column A values, then use your scanner to enter codes in column B.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-29-2015
    Location
    MY
    MS-Off Ver
    office 2010
    Posts
    15

    Re: Is it possible to make barcode scan coding to auto pop up error message box when value

    Thanks for reply JBeaucaire.
    What if i want to compare for the whole column?=B2=A2 is only for specific column, I need it to be whole column.
    Is there any syntax can be use?

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Is it possible to make barcode scan coding to auto pop up error message box when value

    Adjust this for your actual undisclosed columns.... so if you were entering text via scanner in column Z and wanted to make sure that value existed ANYWHERE in columns A:Y, then the DV formula could be:

    =AND(Z2<>"", ISNUMBER(MATCH(Z2, $A2:$Y2, 0))

  5. #5
    Registered User
    Join Date
    08-23-2015
    Location
    Spain
    MS-Off Ver
    2007
    Posts
    32

    Lightbulb Re: Is it possible to make barcode scan coding to auto pop up error message box when value

    Depending how many rows you have... change the source máx. row

    Data > Validation
    Allow: List
    Source: A1:A1000
    Uncheck the list option if you donn't want the list selector show up when selecting that cell...

    But, the right way would be using a dynamic range as source... you can google it, or search for it in this forum, it has been asked/answered many times!
    May the REPUTATION be with me

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Is it possible to make barcode scan coding to auto pop up error message box when value

    Ah, I see I misread the question. Yes, the DV formula I would suggest then would be:

    =ISNUMBER(MATCH(B2, A:A, 0))

+ 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. textbox scan for barcode
    By mathanraj76 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2015, 02:39 AM
  2. [SOLVED] Auto-insert Date after Barcode scan
    By RWTate in forum Excel General
    Replies: 13
    Last Post: 08-13-2014, 01:56 PM
  3. Scan-in, Scan-out tool inventory with barcode scanner
    By rycr023 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2014, 11:52 AM
  4. [SOLVED] barcode scan and save into file
    By mathanraj76 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2014, 10:04 PM
  5. Scan barcode and go to next row
    By dsr301 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2012, 11:33 AM
  6. how to scan a barcode into excel
    By hqradio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2011, 04:57 PM
  7. Replies: 0
    Last Post: 11-08-2010, 03:13 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