Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way I can create a hotkey to format a field from text to datetime? I can use Ctrl+Shift+# (21-Oct-13) to format to Date and Ctrl+Shift+@ (4:19 PM) to format as time. I'd like to see the date and the time. I know I can go into Format Cells... but I'd like a quicker way of doing this.

Is there an easy way to do this or to create a macro to accomplish this?

Excel 2010

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I just recorded the following macro in Excel 2007 but should translate to 2010:

Sub Macro1()
'
' Macro1 Macro
'

'
    Selection.NumberFormat = "[$-409]m/d/yy h:mm AM/PM;@"
End Sub
share|improve this answer
    
I'd have to load that Macro for each excel document? –  Gabe Mar 16 at 1:39
1  
You could, yes. There is another alternative I have not personally used before, but seems to be a reasonable way to go - office.microsoft.com/en-us/excel-help/… –  bmshort Mar 16 at 1:44
    
That'll work perfectly! Thank you! –  Gabe Mar 16 at 4:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.