ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   getting seconds to show in cell (https://www.excelbanter.com/excel-programming/390545-getting-seconds-show-cell.html)

William

getting seconds to show in cell
 
I would like to be able to record the current time in certain cells, by using
the ctrl+shift+; keys. I have went to "Format Cells" "Number" tab, Selected
"Time" and then chose the 24-hour display which included the seconds.
My problem is that when I hit ctrl+shift+; the seconds always show up "00,"
example: 14:25:00. Please let know if there is a way to get the current
second to show up on the time also. Excel 2007. Thanks!!!!!!!!!!!

Gary''s Student

getting seconds to show in cell
 
Enter this small macro:

Sub william()
ActiveCell.NumberFormat = "[$-409]h:mm:ss AM/PM;@"
ActiveCell.Value = Now
End Sub

and assign the shortcut CNTRL-e to it.

Then click on a cell, touch CNTRL-e and the time (properly formatted) will
appear in the cell
--
Gary''s Student - gsnu200726


"William" wrote:

I would like to be able to record the current time in certain cells, by using
the ctrl+shift+; keys. I have went to "Format Cells" "Number" tab, Selected
"Time" and then chose the 24-hour display which included the seconds.
My problem is that when I hit ctrl+shift+; the seconds always show up "00,"
example: 14:25:00. Please let know if there is a way to get the current
second to show up on the time also. Excel 2007. Thanks!!!!!!!!!!!


William

getting seconds to show in cell
 
Bingo!!!!!!!! Works great. Have a great weekend!!!!!!!!!!

"Gary''s Student" wrote:

Enter this small macro:

Sub william()
ActiveCell.NumberFormat = "[$-409]h:mm:ss AM/PM;@"
ActiveCell.Value = Now
End Sub

and assign the shortcut CNTRL-e to it.

Then click on a cell, touch CNTRL-e and the time (properly formatted) will
appear in the cell
--
Gary''s Student - gsnu200726


"William" wrote:

I would like to be able to record the current time in certain cells, by using
the ctrl+shift+; keys. I have went to "Format Cells" "Number" tab, Selected
"Time" and then chose the 24-hour display which included the seconds.
My problem is that when I hit ctrl+shift+; the seconds always show up "00,"
example: 14:25:00. Please let know if there is a way to get the current
second to show up on the time also. Excel 2007. Thanks!!!!!!!!!!!


cblanche

getting seconds to show in cell
 
Thank you sooooo much, Gary's Student. What does the "[$-409]" mean and why
that format?

"Gary''s Student" wrote:

Enter this small macro:

Sub william()
ActiveCell.NumberFormat = "[$-409]h:mm:ss AM/PM;@"
ActiveCell.Value = Now
End Sub

and assign the shortcut CNTRL-e to it.

Then click on a cell, touch CNTRL-e and the time (properly formatted) will
appear in the cell
--
Gary''s Student - gsnu200726


"William" wrote:

I would like to be able to record the current time in certain cells, by using
the ctrl+shift+; keys. I have went to "Format Cells" "Number" tab, Selected
"Time" and then chose the 24-hour display which included the seconds.
My problem is that when I hit ctrl+shift+; the seconds always show up "00,"
example: 14:25:00. Please let know if there is a way to get the current
second to show up on the time also. Excel 2007. Thanks!!!!!!!!!!!


Gary''s Student

getting seconds to show in cell
 
I formatted a cell with the macro recorder turned on and that what I got!!
--
Gary''s Student - gsnu200730


"cblanche" wrote:

Thank you sooooo much, Gary's Student. What does the "[$-409]" mean and why
that format?

"Gary''s Student" wrote:

Enter this small macro:

Sub william()
ActiveCell.NumberFormat = "[$-409]h:mm:ss AM/PM;@"
ActiveCell.Value = Now
End Sub

and assign the shortcut CNTRL-e to it.

Then click on a cell, touch CNTRL-e and the time (properly formatted) will
appear in the cell
--
Gary''s Student - gsnu200726


"William" wrote:

I would like to be able to record the current time in certain cells, by using
the ctrl+shift+; keys. I have went to "Format Cells" "Number" tab, Selected
"Time" and then chose the 24-hour display which included the seconds.
My problem is that when I hit ctrl+shift+; the seconds always show up "00,"
example: 14:25:00. Please let know if there is a way to get the current
second to show up on the time also. Excel 2007. Thanks!!!!!!!!!!!


Dave Peterson

getting seconds to show in cell
 
Debra Dalgleish posted this:

Creating international number formats
http://office.microsoft.com/en-us/ex...346351033.aspx

cblanche wrote:

Thank you sooooo much, Gary's Student. What does the "[$-409]" mean and why
that format?

"Gary''s Student" wrote:

Enter this small macro:

Sub william()
ActiveCell.NumberFormat = "[$-409]h:mm:ss AM/PM;@"
ActiveCell.Value = Now
End Sub

and assign the shortcut CNTRL-e to it.

Then click on a cell, touch CNTRL-e and the time (properly formatted) will
appear in the cell
--
Gary''s Student - gsnu200726


"William" wrote:

I would like to be able to record the current time in certain cells, by using
the ctrl+shift+; keys. I have went to "Format Cells" "Number" tab, Selected
"Time" and then chose the 24-hour display which included the seconds.
My problem is that when I hit ctrl+shift+; the seconds always show up "00,"
example: 14:25:00. Please let know if there is a way to get the current
second to show up on the time also. Excel 2007. Thanks!!!!!!!!!!!


--

Dave Peterson


All times are GMT +1. The time now is 04:44 PM.

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