Entering current date and time

  • Thread starter Thread starter Hoopla
  • Start date Start date
H

Hoopla

Hello

I would like to enter the current date and time by means of a
macro/shortcut. The sheet will be used to record information from a phone
call and I would like to be able to press just a combination of 2 or 3 keys
to 'stamp' the current date and time easily.

I have tried recording a macro using the CTRL+; and CTRL+: commands, but
this doesn't work, as the macro records its value. Now() doesn't work
either, as when I use the macro elsewhere, all the instances of using the
macro are updated to the current time.

I have noticed in an earlier thread that ="current date:
"&TEXT(TODAY(),"dd/mm/yyyy") can be used to enter the current date. Can
this be used successfully within a macro? If so, could somebody explain how
I can use this to incorporate the time, also?

Maybe there's a much simpler way of doing this, I don't know.

If anyone could help me, I'd be most grateful.

Best,

Hoopla.
 
You would need a macro to do this. Something like:

Sub TimeStamp()
Range("A1") = Now
Range("A1").NumberFormat = "d-mmm-yyyy h:mm AM/PM"
End Sub
 
Hi Hoopla,
You might consider an Event macro triggered by entry into
a specific column that checks if your date column is still empty.
You have two dates so you would have to fill in your dates
depending on two different columns instead of just one check.

Place current date constant in Column A when Column B changes (#autodate)
http://www.mvps.org/dmcritchie/excel/event.htm#autodate
DateTimeStamp in Column A, on first entry in any other column on row (#datetimestamp)
http://www.mvps.org/dmcritchie/excel/event.htm#datetimestamp

Note it is more efficient if you format the entire column yourself
rather than one cell at a time when you run a macro.
 
Thank you very much, Vasant.

I amended it slightly to replace the range reference to activecell, and it
works as I need it to.

I'm very grateful.

Hoopla.
 
Thank you for the suggestions, David. The ideas were very useful, but more
complex than I require at the moment.

Thank you for the links though!

Hoopla
 
Back
Top