Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How to enter current static time in Excel in 00:00:00.0 format?
I am using ctrl+shift+; to enter a static time in a spreadsheet but that only
gives hours & minutes without seconds and decimals. I need to have seconds and decimal. Any thoughts? |
#2
|
|||
|
|||
One way:
Put this macro in your Personal.xls or other startup workbook. Attach it to a toolbar button, or give it a keyboard shortcut. Public Sub ExtendedTime() If TypeOf Selection Is Range Then With ActiveCell .NumberFormat = "hh:mm:ss" .Value = Time End With End If End Sub In article , "Wlumkong" wrote: I am using ctrl+shift+; to enter a static time in a spreadsheet but that only gives hours & minutes without seconds and decimals. I need to have seconds and decimal. Any thoughts? |
#3
|
|||
|
|||
You would have to create a macro, the easiest form of macro for this
would be an event macro. You could trigger it on replacing an empty cell in a specific column, or when another column is filled in. DateTimeStamp in Column A, on first entry in any other column on row (#datetimestamp) http://www.mvps.org/dmcritchie/excel...#datetimestamp Place current date constant in Column A when Column B changes (#autodate) http://www.mvps.org/dmcritchie/excel/event.htm#autodate The following will put the time into Column B when an entry is made in Column A install by right click on sheet tab, View code, .place the following code there Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column < 1Then Exit Sub If Target.Row = 1 Then Exit Sub If IsEmpty(Target.Offset(0, 1)) Then Target.Offset(0, 1) = Time Target.offset(0, 1).numberformat = "hh:mm:ss.00" End If End Sub --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Wlumkong" wrote in message ... I am using ctrl+shift+; to enter a static time in a spreadsheet but that only gives hours & minutes without seconds and decimals. I need to have seconds and decimal. Any thoughts? |
#4
|
|||
|
|||
Thanks. That did it.
Wayne "David McRitchie" wrote: You would have to create a macro, the easiest form of macro for this would be an event macro. You could trigger it on replacing an empty cell in a specific column, or when another column is filled in. DateTimeStamp in Column A, on first entry in any other column on row (#datetimestamp) http://www.mvps.org/dmcritchie/excel...#datetimestamp Place current date constant in Column A when Column B changes (#autodate) http://www.mvps.org/dmcritchie/excel/event.htm#autodate The following will put the time into Column B when an entry is made in Column A install by right click on sheet tab, View code, .place the following code there Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column < 1Then Exit Sub If Target.Row = 1 Then Exit Sub If IsEmpty(Target.Offset(0, 1)) Then Target.Offset(0, 1) = Time Target.offset(0, 1).numberformat = "hh:mm:ss.00" End If End Sub --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Wlumkong" wrote in message ... I am using ctrl+shift+; to enter a static time in a spreadsheet but that only gives hours & minutes without seconds and decimals. I need to have seconds and decimal. Any thoughts? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do you enter a negative time number in Excel? | Excel Discussion (Misc queries) | |||
How do I enter the date last modified in the footer of an Excel d. | Excel Discussion (Misc queries) | |||
How do I enter a working check box option in Excel? | Excel Discussion (Misc queries) | |||
Office 97 to 2003: Excel: enter data w/fixed 2 decimal. 2000. be. | New Users to Excel | |||
Calculating tvl time in Excel 2000 Rev.9.2720 | Excel Worksheet Functions |