ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Display Seconds when inserting time in cells (https://www.excelbanter.com/excel-discussion-misc-queries/156387-display-seconds-when-inserting-time-cells.html)

jane93

Display Seconds when inserting time in cells
 
Hello
I'm using the CTRL+SHIFT+; to insert time into a cell. I have formatted the
cell to display HH:mm:ss, but seconds are only displayed as Zeroes and never
update.

Can you please tell me how to stamp time including seconds?

Thanks
--
regards, jane93

David Biddulph[_2_]

Display Seconds when inserting time in cells
 
Use =NOW(), then paste special/ values to keep the data without further
recalculation.
--
David Biddulph

"jane93" wrote in message
...
Hello
I'm using the CTRL+SHIFT+; to insert time into a cell. I have formatted
the
cell to display HH:mm:ss, but seconds are only displayed as Zeroes and
never
update.

Can you please tell me how to stamp time including seconds?

Thanks
--
regards, jane93




Dave Peterson

Display Seconds when inserting time in cells
 
You could use a macro that "steals" the ctrl-shift-colon keystroke.

If you want to try, create a workbook that includes this code and store it in
your XLStart folder. Lots of people use a workbook named Personal.xls for this
kind of thing.

Option Explicit
Sub Auto_Open()
Application.OnKey "+^:", "'" & ThisWorkbook.Name & "'!Nowtime"
End Sub
Sub Auto_Close()
Application.OnKey "+^:"
End Sub
Sub NOWTIME()
On Error Resume Next
With Selection
.Value = Now
.NumberFormat = "hh:mm:ss"
End With
If Err.Number < 0 Then
Beep
End If
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


jane93 wrote:

Hello
I'm using the CTRL+SHIFT+; to insert time into a cell. I have formatted the
cell to display HH:mm:ss, but seconds are only displayed as Zeroes and never
update.

Can you please tell me how to stamp time including seconds?

Thanks
--
regards, jane93


--

Dave Peterson

jane93

Display Seconds when inserting time in cells
 
Thanks for the macro -- it works great, and the web page stepped me through
how to load it.

I am totally new to Excel macros, and am interested how you knew which
functions to use? I am trying to use "help" in Excel, but I kind of have to
know what I'm looking for!

--
regards, jane


"Dave Peterson" wrote:

You could use a macro that "steals" the ctrl-shift-colon keystroke.

If you want to try, create a workbook that includes this code and store it in
your XLStart folder. Lots of people use a workbook named Personal.xls for this
kind of thing.

Option Explicit
Sub Auto_Open()
Application.OnKey "+^:", "'" & ThisWorkbook.Name & "'!Nowtime"
End Sub
Sub Auto_Close()
Application.OnKey "+^:"
End Sub
Sub NOWTIME()
On Error Resume Next
With Selection
.Value = Now
.NumberFormat = "hh:mm:ss"
End With
If Err.Number < 0 Then
Beep
End If
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


jane93 wrote:

Hello
I'm using the CTRL+SHIFT+; to insert time into a cell. I have formatted the
cell to display HH:mm:ss, but seconds are only displayed as Zeroes and never
update.

Can you please tell me how to stamp time including seconds?

Thanks
--
regards, jane93


--

Dave Peterson


Dave Peterson

Display Seconds when inserting time in cells
 
It may be time to get a reference book.

I don't think you can go wrong by starting with John Walkenbach's books.

Debra Dalgleish has a list of books at her site:
http://www.contextures.com/xlbooks.html

See if you can find them in your local bookstore/internet site and you can
choose what one you like best.

jane93 wrote:

Thanks for the macro -- it works great, and the web page stepped me through
how to load it.

I am totally new to Excel macros, and am interested how you knew which
functions to use? I am trying to use "help" in Excel, but I kind of have to
know what I'm looking for!

--
regards, jane

"Dave Peterson" wrote:

You could use a macro that "steals" the ctrl-shift-colon keystroke.

If you want to try, create a workbook that includes this code and store it in
your XLStart folder. Lots of people use a workbook named Personal.xls for this
kind of thing.

Option Explicit
Sub Auto_Open()
Application.OnKey "+^:", "'" & ThisWorkbook.Name & "'!Nowtime"
End Sub
Sub Auto_Close()
Application.OnKey "+^:"
End Sub
Sub NOWTIME()
On Error Resume Next
With Selection
.Value = Now
.NumberFormat = "hh:mm:ss"
End With
If Err.Number < 0 Then
Beep
End If
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


jane93 wrote:

Hello
I'm using the CTRL+SHIFT+; to insert time into a cell. I have formatted the
cell to display HH:mm:ss, but seconds are only displayed as Zeroes and never
update.

Can you please tell me how to stamp time including seconds?

Thanks
--
regards, jane93


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 11:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com