Show time stamp when a value is entered

G

Guest

I use a scanner in my classroom to record attendance. Students highlight the
cell next to their name on a roster then scan their ID. It enters their ID
number in the cell. I would like the time the card was scanned to show up
instead. I played around with the If and Now formulas but could not get it to
work. I'm thinking of a macro that whenever any value is entered in the cell
it shows time instead. Any ideas?
 
S

Sandy

Here the way using the IF and NOW() functions
Cells used A1 & B1 where A1 is the result of the scanner and B1 is your
formula.



=If(A1<>0,Now(),"")
This will work if you don't mind having another column.
 
O

Otto Moehrbach

Perhaps something like this. This a sheet macro and must be placed in the
sheet module of your sheet. As written, this macro will change any entry
made in Column B, in any row greater than 1, to the current system time.
HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If IsEmpty(Target.Value) Then Exit Sub
If Target.Column = 2 And _
Target.Row > 1 Then Target.Value = Time
End Sub
 
S

stevebriz

here is one idea

if thesstudents name is in columna Id numbers are entered in Col B and
you want date/time in Col C
add this macro to the worksheet thorugh the VBeditor

Private Sub Worksheet_Change(ByVal Target As Range)


If Target.Column = 2 Then Target.Offset(0, 1).Value = Date & " " & time

End Sub
 
G

Gord Dibben

This will update every time the sheet is re-calculated.

I believe OP wants a static time.

See Otto's post.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top