How to create a scanner barcode timesheet in excel

Posted on 2012-08-30
Last Modified: 2012-09-22

Im working on creating a employee timesheet  in excel. I have a scanner connected my laptop.

What I want to do is scanned their badge that contains their employee number and in another cell name time the time will appear.

does anybody know what formula I can use that the time and date will appear on a cell when I can the badge.
Question by:LENERO
    LVL 10

    Assisted Solution

    This formula will return the current date/time based on a non-blank entry in the reference cell:


    The formula checks to see if the reference cell (A1) contains a value.  If it does, the function NOW() returns the current date and time.  If the reference cell is blank, the formula returns nothing (i.e., remains "blank").

    You'll have to format the column/cell to the desired date/time format.
    LVL 10

    Assisted Solution

    @mark_harris231, that formula gets recalculated every time Excel performs calculations on the worksheet. Every time a badge was scanned, it would update the time in every row to the current time.
    LVL 10

    Accepted Solution

    The subroutine that follows will update the cell in column B to the current time whenever a cell in column A is changed. Add the routine to the worksheet.
    Private Sub Worksheet_Change(ByVal Target As Range)
        If Target.Column = 1 Then
            Target.Cells(1, 2).Value = Now()
        End If
    End Sub

    Open in new window

    Let me know if you need help adding the code to your worksheet.

    Also, if you want to look a column other than "A" then change the value in the If statement to match the column you want (A=1, B=2, etc.).

    The code updates the adjacent column (to the right) to the current date/time. If you wanted a different column, change to "2" to indicate how far over from the current cell (which is always "1") it should move.

    Author Closing Comment

    thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    Min Month2 5 16
    Subform Link field 13 19
    MS Access 2010 - Error 53-File Not Found 27 23
    Access 2013 combo box not working 3 10
    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
    This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now