View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default User of : in times

houghi,

Copy the code below, right-click the sheet tab, select "View Code" and paste the code into the
window that appears.

Format the cells where you want to enter the time as TEXT, then enter all the times as 6 digit
number strings (with leading zeroes, if needed)

001123 will result in 00:11:23

120345 will give 12:03:45

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myTime As Date
If Target.Cells.Count 1 Then Exit Sub
If Len(Target.Value) < 6 Then Exit Sub
If Not IsNumeric(Target.Value) Then Exit Sub
Application.EnableEvents = False
myTime = TimeValue(Left(Target.Value, 2) & ":" & _
Mid(Target.Value, 3, 2) & ":" & Right(Target.Value, 2))
Target.NumberFormat = "hh:mm:ss"
Target.Value = myTime
Application.EnableEvents = True
End Sub


"houghi" wrote in message ...
I have recieved a huge list on paper with a LOT of times on it in the
format 12:34:56. Unfortunatly it is not possible to recieve the list
digitaly.

I need to enter these and the thing that disturbes me most is that I
have to type the : which is awkward with the <shift<;

Is there a way that I can use the - key on the numeric keyboard to
display the : in excel? That would speed things up a LOT for me.

I have searched googe and was not able to find anything, so I am not
sure wether this is possible.

houghi
--
Listen do you hear them drawing near in their search for the sinners?
Feeding on the power of our fear and the evil within us.
Incarnation of Satan's creation of all that we dread.
When the demons arrive those alive would be better off dead!