Solved

How to create a scanner barcode timesheet in excel

Posted on 2012-08-30
1,532 Views
Hello,

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.
0
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:

=IF(A1<>"",NOW(),"")

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.
0

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.
0

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
``````
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.
0

Author Closing Comment

thank you
0

Write Comment

Please enter a first name

Please enter a last name

We will never share this with anyone.

Featured Post

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.

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!