Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Wlumkong
 
Posts: n/a
Default 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   Report Post  
JE McGimpsey
 
Posts: n/a
Default

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   Report Post  
David McRitchie
 
Posts: n/a
Default

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   Report Post  
Wlumkong
 
Posts: n/a
Default

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
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 you enter a negative time number in Excel? Thomas99 Excel Discussion (Misc queries) 4 March 17th 05 11:42 PM
How do I enter the date last modified in the footer of an Excel d. Last modified date in footer Excel Discussion (Misc queries) 1 February 6th 05 11:12 PM
How do I enter a working check box option in Excel? Lisa the CPA Excel Discussion (Misc queries) 1 January 31st 05 07:07 AM
Office 97 to 2003: Excel: enter data w/fixed 2 decimal. 2000. be. terrier New Users to Excel 1 January 29th 05 10:59 AM
Calculating tvl time in Excel 2000 Rev.9.2720 Brandi Excel Worksheet Functions 5 January 27th 05 09:15 PM


All times are GMT +1. The time now is 09:17 PM.

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

About Us

"It's about Microsoft Excel"