+ Reply to Thread
Results 1 to 14 of 14

Auto-insert Date after Barcode scan

  1. #1
    Registered User
    Join Date
    08-13-2014
    Location
    Ottawa, Ontario
    MS-Off Ver
    2007
    Posts
    7

    Auto-insert Date after Barcode scan

    Greetings; I hope one of you knowledgeable people can help me with a problem I have getting the date to auto-fill in Excel. The situation is this. I am working on a spreadsheet that will accept inputs from a scanner. I have solved all issues to date but this one. When one of our product testers has tested a unit and it passes or fails he scans one of two barcodes that has his name and either "pass" or "fail" embedded in it. I would like the next cell in the column to the right to auto-fill the date. The cue to do that would be if anything has been entered in the cells to its left.

    If I was to describe the logic it would be something like;

    if A1 or B1 contain any characters whatsoever enter date and time in C1
    if A2 or B2 contain any characters whatsoever enter date and time in C2
    etc. etc.


    Thanks in advance for your help.

    Cheers
    Ron

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Auto-insert Date after Barcode scan

    Hi Ron,

    This is 'sheet-level code:

    Please Login or Register  to view this content.
    Let me know if this works for you.

    abousetta
    Last edited by abousetta; 08-13-2014 at 01:39 PM.
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    08-13-2014
    Location
    Ottawa, Ontario
    MS-Off Ver
    2007
    Posts
    7

    Re: Auto-insert Date after Barcode scan

    Hi Abousetta; I inserted the code and tried it but it didn't add the date. I tried two barcodes, one that tabs to the next cell over and one that doesn't. Neither worked. Your efforts are very much appreciated.

    Cheers

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Auto-insert Date after Barcode scan

    Last edited by abousetta; 08-13-2014 at 01:09 PM.

  5. #5
    Registered User
    Join Date
    08-13-2014
    Location
    Ottawa, Ontario
    MS-Off Ver
    2007
    Posts
    7

    Re: Auto-insert Date after Barcode scan

    Right click, view code, Worksheet. Alt-Q, and saved.

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Auto-insert Date after Barcode scan

    Take a look at the attachment
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-13-2014
    Location
    Ottawa, Ontario
    MS-Off Ver
    2007
    Posts
    7

    Re: Auto-insert Date after Barcode scan

    That's what mine now looks like. In "general" and "declarations". Still no date.

  8. #8
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Auto-insert Date after Barcode scan

    In the example I uploaded, if you put anything in columns A or B then click enter (aka moving to the next cell below) it adds the date to column C. Try that and let me know if this works in the example file.

  9. #9
    Registered User
    Join Date
    08-13-2014
    Location
    Ottawa, Ontario
    MS-Off Ver
    2007
    Posts
    7

    Re: Auto-insert Date after Barcode scan

    I don't see my last post so here it is again.

    It works fine in your example. Still not working in my spreadsheet though. Also I used A1/B1 as example columns. The actual columns used might be in the F-G-H range when the spreadsheet is finished.

  10. #10
    Registered User
    Join Date
    08-13-2014
    Location
    Ottawa, Ontario
    MS-Off Ver
    2007
    Posts
    7

    Re: Auto-insert Date after Barcode scan

    It now works. Thank you..Thank you. My guess is if I change the A:B values to be my column designations then it would work further into the spreadsheet.

    Cheers
    Ron

  11. #11
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Auto-insert Date after Barcode scan

    OK... for testing purposes, I have put a message box that will be triggered when you add new data to columns A or B to let you know that the code was triggered. I have also highlighted the Range that will need to be changed in the final code (e.g. from Range("A:B") to Range("F:G"))

    So now with new code you should at least be getting a few annoying msgboxes. If not, then the code isn't being triggered and I would want to see you the file you are working on.

  12. #12
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Auto-insert Date after Barcode scan

    Glad it worked out. You can remove the Msgbox (green line) and adjust the range (red)

  13. #13
    Registered User
    Join Date
    08-13-2014
    Location
    Ottawa, Ontario
    MS-Off Ver
    2007
    Posts
    7

    Re: Auto-insert Date after Barcode scan

    Your help is most appreciated.

    Cheers
    Ron

  14. #14
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Auto-insert Date after Barcode scan

    Glad I could help. Don't forget to mark the thread as solved.

+ 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. 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
  2. [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
  3. 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
  4. 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
  5. 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