+ Reply to Thread
Results 1 to 7 of 7

Macro for using a Barcode scanner

  1. #1
    Registered User
    Join Date
    05-11-2012
    Location
    birmingham,uk
    MS-Off Ver
    Excel 2007
    Posts
    5

    Macro for using a Barcode scanner

    Hello all I have a quick question I have bought a barcode scanner to hopefully make entering bills a bit quicker and more accurate, but I cannot get it to read the correct amount from the bills and input into an excel file.


    The vales of the bill I want to enter is 25.27

    The whole barcode is 620997830109120000000252700000001209210388072652 but what I want entered is only the 25.27 in the middle of the barcode as this is the value of the bill I need to enter.


    When I use the scanner in word the whole barcode of 620997830109120000000252700000001209210388072652 is read so it seems that there is no problem reading the barcode, but just getting excel to enter the value of the bill.


    I think all that is needed is a macro that knows where the data will be and can discard the numbers that I do not need, but I cannot work out how to do this ?

    Any help/advice would be much appreciated.

    I look forward to any replies, help, or points in the right direction.


  2. #2
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    915

    Re: Macro for using a Barcode scanner

    Supposing your barcode is in C1 use this formula in a help column D1 to extract the value:

    =MID(C1,15,11)/100

    May need to format column D as Number with 2 decimals.


    Otherwise you could use a macro in the sheets' code module (untested because I don't own a barcode scanner):
    Please Login or Register  to view this content.
    Last edited by rollis13; 09-06-2012 at 03:43 PM. Reason: integration

  3. #3
    Registered User
    Join Date
    05-11-2012
    Location
    birmingham,uk
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Macro for using a Barcode scanner

    Thanks a lot I will give it a go and let you know the outcome.

  4. #4
    Registered User
    Join Date
    05-11-2012
    Location
    birmingham,uk
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Macro for using a Barcode scanner

    I tried the formula and it doesnt work, by the way I forgot to mention that in excel the barcode is scanned as 6.20998E+47 as it seems excel cannot deal wth the large number of the barcode which is 620997830109120000000252700000001209210388072652

    Sorry to be a pain but my macro skils are extremely poor, could you run through step by step how to record that macro?

    Thanks

    Ben

  5. #5
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    915

    Re: Macro for using a Barcode scanner

    Formatting your column to Text before using it should do the trick. Then you will have to format the cell back to Number to be of any use.
    Since don't have a scanner my testing was done copying your string as text data.
    Please Login or Register  to view this content.
    Last edited by rollis13; 09-07-2012 at 05:25 PM.

  6. #6
    Registered User
    Join Date
    05-11-2012
    Location
    birmingham,uk
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Macro for using a Barcode scanner

    Hi thanks but how I do I record the Macro? Could you possibly tell me how to do this step by step?

    thanks Ben

  7. #7
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    915

    Re: Macro for using a Barcode scanner

    Sorry, it isn't a recorded macro, it comes out of my mind (with what I learned in this Forum )

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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