Fireman1224
New Member
- Joined
- Oct 20, 2008
- Messages
- 42
Tried to follow the instructions:
http://www.youtube.com/user/bjele123#p/c/76C979CEFD1A4B30/42/FVTB6ruazJU
but I can't get the proper time to display..it works for times >10:00, but 00:00 to 09:59 is weird. Here is the code I used in Excel 2007
Private Sub Worksheet_Change(ByVal Target As Range)
If IsEmpty(Target) Then
Exit Sub
ElseIf Target.Column = 16 Then
Application.EnableEvents = False
Target.Value = Left(Target.Value, 2) & ":" & Right(Target.Value, 2)
Application.EnableEvents = True
End If
End Sub
I also want to replace Target.Column =16 to all cells within a named range "Time".
Please Help!
http://www.youtube.com/user/bjele123#p/c/76C979CEFD1A4B30/42/FVTB6ruazJU
but I can't get the proper time to display..it works for times >10:00, but 00:00 to 09:59 is weird. Here is the code I used in Excel 2007
Private Sub Worksheet_Change(ByVal Target As Range)
If IsEmpty(Target) Then
Exit Sub
ElseIf Target.Column = 16 Then
Application.EnableEvents = False
Target.Value = Left(Target.Value, 2) & ":" & Right(Target.Value, 2)
Application.EnableEvents = True
End If
End Sub
I also want to replace Target.Column =16 to all cells within a named range "Time".
Please Help!