inserting current short date into an Excel document

  • Thread starter Thread starter Steve Forman
  • Start date Start date
S

Steve Forman

I know that you can insert the current date into Excel by hitting
"control ;" however, I am trying to enter it into a password protected
field where the default was set to text format.
Even though my regional settings are set to display the date in short
format, i.e. 3/8/04 because the cell is formatted as text, it is
showing up as 3/8/2004.
How can I change this easily so that I can just insert it as a short
date format (3/8/04) with that shortcut key combination?
Is this even possible?
 
I think your only recourse is to use a macro:

Sub EnterShortDate()
ActiveCell.Value = Format(Now, "m/d/yy")
End Sub

You could assign that macro to Ctrl-; with this macro:

Sub AssignKey()
Application.OnKey "^;", "EnterShortDate"
End Sub


--
Jim Rech
Excel MVP
| I know that you can insert the current date into Excel by hitting
| "control ;" however, I am trying to enter it into a password protected
| field where the default was set to text format.
| Even though my regional settings are set to display the date in short
| format, i.e. 3/8/04 because the cell is formatted as text, it is
| showing up as 3/8/2004.
| How can I change this easily so that I can just insert it as a short
| date format (3/8/04) with that shortcut key combination?
| Is this even possible?
 
Back
Top