As you have learned in other ExcelTips, you can use Ctrl+: (that's a colon) to enter the current time into a cell. The resulting cell value is equal to the hours and minutes of the current time. In other words, the seconds will always be zero.
If you want to insert the current time and have it include the seconds, the best way is to use a macro. You can then assign the macro to a keyboard shortcut or a toolbar button (or both) so it can be immediately popped into place. The following macro will do the trick nicely:
Sub TimeStamp() ActiveCell.Value = Time ActiveCell.NumberFormat = "h:mm:ss AM/PM" End Sub
Notice that the time is placed in the cell and then the cell is formatted to show hours, minutes, and seconds.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10635) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel here: Inserting the Current Time with Seconds.
Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!
One way you can use macros in a workbook is to have them automatically triggered when certain events take place. Here's ...
Discover MoreWhen you open multiple workbooks, the way in which Excel sizes them is not the best for your needs. This tip looks at a ...
Discover MoreNeed to normalize your data in some way so that all your values are in a given format? This tip presents a number of ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2020-10-08 14:06:20
KGF
This is very helpful! Exactly what I was looking for. Thank you!
2019-08-24 06:49:20
RAMANAND
I WANT TO ADD DATA IN CELL A(SCANNING) AND I WANT TIME IN CELL B, I WANT TO SEE THE TIME TO SCAN
2017-08-19 06:18:08
Willy Vanhaelen
@Walt
Perhaps the macro solution in this tip is what you are looking for:
https://excelribbon.tips.net/T013233_Automatically_Entering_a_Data_Entry_Time.html
If so see also my comment of 2016-02-21 there.
2017-08-18 11:45:52
I am creating a spreadsheet for co-workers to use that have little or no excel experience. In order to make it easy for them I am trying to insert the current date and time in a cell to record when an action occurred. That date and time must remain and not change.
I have been able to insert a calendar to select a date. I cannot find a way to insert the actual time that will remain static. I also cannot find a 'clock' that actually keeps current time. What I've inserted is a time that doesn't change.
It seems like I need VBA code to do this. Any thoughts.
2017-05-24 17:26:08
Fradi
Great
2017-03-08 19:29:40
HARINATH KOTLA
Thank you
2017-02-18 12:19:16
Peter Atherton
Rick
Unless you prefer the 24 hour clock and use "[h]:mm:ss"
2017-02-17 14:40:14
Lisa
Brilliant! This is just what I needed for my project! Thank you!
2016-12-10 05:45:35
Rick Rothstein
I am confused. When I run the macro without that NumberFormat line of code, the time still goes into the cell correctly, with the seconds, and the cell's format is changed to Custom "h:mm:ss AM/PM" automatically. I do not see why you thought you needed to manually format the cell via the macro. If it makes a difference, I am using XL2010 on Win 8.1.
2015-03-30 14:49:12
Jake
HAHA exactly what I was looking for. A lot of other sites either gave the NOW() or Ctr + : tips but those were useless for a person who needed the seconds. Very easy and now I get to say I made a macro. (Fist pump)
2015-01-09 09:06:57
Mike O\'Neill
Hi. I posted this tip on the Excel 2007 page, now repeating it here: If you do not want to use macros, or are unable to, then a simple but less elegant option is to enter the formula
=NOW()
in the formula bar, then immediately press f9 <Enter> to fix the value. Make sure that the cells in the column or cell are formatted to show the time in seconds.
It is a short formula so not too much work. But if you need to do it multiple times you could first copy the =NOW() into the copy buffer, then use the following sequence of keystrokes to paste into the formula bar as follows:
<F2> <Paste> <F9> <Enter>
(Where <Paste> is Ctrl-V or equivalent)
2014-10-26 09:51:26
BHershman
Michael (Micky) Avidan:
You are quite right. I misread the hint.
2014-10-26 06:57:59
Michael (Micky) Avidan
@BHershman,
The tip says very clearly:
you can use Ctrl+: (that's a colon) to enter the current time into a cell. The resulting cell value is equal to the hours and minutes of the current time. In other words, the seconds will always be zero.
Watch, carefully, the last 9 words.
Any "Date/Time" worksheet function is Volatile - and as such will be re-calculate upon every sheet recalculation.
The only way to insert and PRESERVE(!) the current Date/Time is with VBA Code.
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)
ISRAEL
2014-10-25 19:32:28
Peter Atherton
The trouble with Ctrl+: is that it is formatted to the nearest minute. The macro inserts the time value so will not recalculate. Also by assigning a Keyboard shortcut of say Ctrl+T it is no harder to enter than the Excel Function
2014-10-25 14:25:25
BHershman
The macro is not strictly necessary.
If you use the "=NOW()" formula or the "Ctrl+:" shortcut in a cell or column already formatted to show seconds, that is exactly what it will do.
Incidentally:
(1) When you put the current time into a cell by any of these methods, there is a good chance that by the time it is displayed in the cell the seconds will no longer be right.
(2) How do you ensure that cells holding the current time formula do not recalculate whenever the worksheet is itself recalculated?
If that is not what you want, you must use the "Ctrl+:" shortcut
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2021 Sharon Parq Associates, Inc.
Comments