Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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!!!!!!!!!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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!!!!!!!!!!!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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!!!!!!!!!!!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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!!!!!!!!!!!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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!!!!!!!!!!!



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I show amount of time in minutes and seconds? TitanG Excel Worksheet Functions 6 September 9th 08 01:24 AM
Converting Julian Seconds with a macro to replace old seconds data Keldair Excel Discussion (Misc queries) 2 February 18th 06 12:09 AM
Code to show current hour minute and seconds in a cell Dr.H.Subramanian[_2_] Excel Programming 2 August 11th 05 11:02 AM
Convert "Time Interval" in "hours : minutes : seconds" to seconds Ianukotnorth New Users to Excel 7 May 8th 05 08:11 PM
Subtracting time in excel to show in minutes:seconds Gabe Excel Programming 1 September 2nd 04 07:32 PM


All times are GMT +1. The time now is 07:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"