Excel Utilities

How to retrieve the Current time in the Excel Sheet with macros ?

You would be better off using the =NOW() function, the only problem with this is that it will alter every time the sheet is recalculated.

1.Go to Your Excel Sheet

Tools -> Record Macros -> Create New (or)

View-> Macros->Record Macro

2.Provide the Shortcut that you want to use (For E.g :T)

3.Copy Paste the following code

Sub Macro1()

‘ Macro1 Macro

‘ Keyboard Shortcut: Ctrl+t
ActiveCell.FormulaR1C1 = “=NOW()”
With Selection
.NumberFormat = “h:mm:ss;@”
.Formula = .Value
End With

End Sub

4.Save and Go to your Excel Sheet( which is in the right hand corner It ll be as button format)

Leave a comment

Design a site like this with WordPress.com
Get started