Inserting static date AND time

B

Barb Reinhardt

I've found that you can insert either a static date using
[Ctrl] + [:;]
or a static time using
[Ctrl] + [Shift] + [:;]

Is there a way to enter a static date and time without adding the two
together?

Thanks in advance,

Barb Reinhardt
 
L

Lonnie M.

Hi, I'm not sure if this is what you are looking for, but playing
around with your example I found that you can combine them.
Add the date, press the spacebar, and then add the time--Excel
recognizes this as a date / time value.
HTH--Lonnie M.
 
G

Gord Dibben

Barb

Macro OK?

Sub NOWTIME()
ActiveCell.Value = Format(Now(), "dd-mm-yyyy h:mm:ss AM/PM")
End Sub

Assign to a button or shortcut key combo.

Gord Dibben Excel MVP
 
B

Barb Reinhardt

Thanks! I knew about the NOW function, but didn't want to fool around with
a copy/paste special to get the value.

Gord Dibben said:
Barb

Macro OK?

Sub NOWTIME()
ActiveCell.Value = Format(Now(), "dd-mm-yyyy h:mm:ss AM/PM")
End Sub

Assign to a button or shortcut key combo.

Gord Dibben Excel MVP

I've found that you can insert either a static date using
[Ctrl] + [:;]
or a static time using
[Ctrl] + [Shift] + [:;]

Is there a way to enter a static date and time without adding the two
together?

Thanks in advance,

Barb Reinhardt
 
L

Lonnie M.

Hey, I was just playing with Barb's example. I thought it was pretty
cool too. I hadn't seen that before.
 
G

Guest

if you're using this Excel BS, eventually you're going to copy and paste..
and you'll have to deal with that type of stuff

Move to Access, it is time to grow up




Barb Reinhardt said:
Thanks! I knew about the NOW function, but didn't want to fool around with
a copy/paste special to get the value.

Gord Dibben said:
Barb

Macro OK?

Sub NOWTIME()
ActiveCell.Value = Format(Now(), "dd-mm-yyyy h:mm:ss AM/PM")
End Sub

Assign to a button or shortcut key combo.

Gord Dibben Excel MVP

I've found that you can insert either a static date using
[Ctrl] + [:;]
or a static time using
[Ctrl] + [Shift] + [:;]

Is there a way to enter a static date and time without adding the two
together?

Thanks in advance,

Barb Reinhardt
 
Top