Formatting a row to insert current date and time on demand

M

MorseCode

I would like to have an icon to select that will insert the current date and
time. I attempted to make a macro to accomplish this and it worked great
UNTIL I figured out that every time I entered a new date, it changed them
ALL.

I need for the date and time to be possibly different. When I use Ctrl + ;
I get the date then space once and use Ctrl + Shift + ; and you get the time.
This works great however I dont want to do this every time I need this data.

PLEASE HELP!
:(
Signed Frustrated in SC....
 
J

JE McGimpsey

One way:

Public Sub InsertDateAndTimeInActiveCell()
With ActiveCell
.Value = Now
.NumberFormat = "dd mmmm yyyy hh:mm:ss"
End With
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

Top