NOW() function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to create an automated time-card file, where you enter your name
in one column and automatically the date is entered in a second column and
the current time is entered in a third column. So far, so good! (Yes, I can
get this to happen!). However, the problem arises with the NOW()
function..... whenever you enter a value for NOW() in any cell, it changes
the value of NOW() EVERYWHERE on the worksheet! So no matter when you enter
your name originally, the time listed will always be the time the last person
entered their name! Any idea how to correct this?
 
redingto, have a look here for a way to do it

http://www.mcgimpsey.com/excel/timestamp.html
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
You need to use some VBA to do this, the following will work. Tweak the
Offset() function to get the right cells you like. The first input changes
the row, second changes the column.

Sub worksheet_change(ByVal target As Range)
ActiveCell.Offset(-1, 1) = Now() 'format as date
ActiveCell.Offset(-1, 2) = Now() 'format as time
End Sub
 

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

Back
Top