Excel Time Function

  • Thread starter Thread starter Claire
  • Start date Start date
C

Claire

Hi:

How do I include seconds into the time clock on a
spreadsheet?

Specifically, if I use the keystroke of ctrl+shift+; I
received the time as shown in my PC clock. However, I
would also like the seconds to show up when I use this
keystroke.

Is there a way to do this?

If not, how can I change the Now() function ( or
something similar) to input the time into the cell and
not make it a dynamic function? I would like the time
with seconds to show and stay as entered, not update with
the time on my computer.

Thanks a bunch!!
 
Claire

I could be wrong but it looks to me as though you get hours and minutes and
the seconds are zero. So, although you can format the cell to show the
seconds, it will always be zero (hh:mm:ss). At least it does for me ;-)

Regards

Trevor
 
Yah that's the problem. I need to incorporate seconds as
this is being used in a timed endurance horse race and
every second counts as they say!!
 
Someone may prove me wrong, but I believe you have to use VBA to get
the seconds.

Enter the code below in a standard module:

Option Explicit

Sub setKey()
Application.OnKey "+^:", "EnterTime"
End Sub
Sub resetKey()
Application.OnKey "+^:"
End Sub
Sub EnterTime()
With ActiveCell
.Value = Time()
.NumberFormat = "hh:mm:ss"
End With
End Sub

Now, once you run the setKey procedure, the CTRL+SHIFT+: will give you
the time in seconds. To return to the default behavior, run the
resetKey procedure.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
Back
Top