Adding Date and Time to an Excel worksheet by one click Excel ( macro )

The fol­low­ing macro will enter the cur­rent date and time in the active cell with­out mov­ing the cur­sor. The date and time will be entered as a dat­e­val­ue, mean­ing that it will not change every time you open the work­book.

1,Open your work­book
Copy this macro to the clip­board

Sub Set_DateTime()
ActiveCell.Value = Format(Now(), "h:mm:ss")
End Sub

2,Next press ALT + F11
Insert > Mod­ule
Paste the macro into the Mod­ule area to the right

3,Close the VBE and return to Excel
4,Click Tools > Macro > Macros
Click ‘Options’

Enter the let­ter you wish to use as a key­board short­cut.
I usu­al­ly use ‘a’ because it is close to the Ctrl key.
Close back to Excel

Now, when you press Ctrl + a (or what­ev­er let­ter you chose)
the date and time will be insert­ed into the active­cell.

Note: if you want the date and time to be auto­mat­i­cal­ly entered into a spe­cif­ic cell when you open the work­book, let me know and I will amend the macro.

SOURCE

LINK INTEREST
Date with my sheet – 10 tips on using date / time in excel
http://chandoo.org/wp/2008/07/29/excel-keyboard-shortcuts/
http://office.microsoft.com/en-us/excel-help/keyboard-shortcuts-in-excel-HA102772370.aspx

Face­book Com­ments