Enter time in seconds
Do you want to enter the current time in a
cell so that it doesn't change each time Excel recalculates
formulas? Then, use CTRL+SHIFT+: However, Excel only
provides the time in hours and minutes or HH:MM. To enter
the time so that it includes seconds, one has to override the
default behavior. 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 Excel to
its default behavior, run the resetKey procedure.
By accessing any page or link on this web
site other than this
page, you agree to the
terms and conditions. |