Hi,
Here is some rather more complex code which you can cut down to what you need:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim I As Integer
Set isect = Application.Intersect(Target, Range("Time"))
If isect Is Nothing Then Exit Sub 'not inside the desired range
If Target.Count > 1 Then Exit Sub 'more than one cell selected
Application.EnableEvents = False
'Numeric entries
If Target >= 1 Then
If Len(Target) = 1 Then
Target = Target & " AM"
ElseIf Len(Target) = 2 Then
If Target <= 12 Then
Target = Target & " AM"
Else
Target = Target - 12 & " PM"
End If
ElseIf Len(Target) = 3 Then
Target = Left(Target, 1) & ":" & Right(Target, 2)
Application.EnableEvents = True
Exit Sub
ElseIf Len(Target) = 4 Then
Target = Format(Left(Target, 2) & ":" & Right(Target, 2),
"HH:MM AM/PM")
Application.EnableEvents = True
Exit Sub
Else
MsgBox "That entry is not a legal time."
Target.ClearContents
Application.EnableEvents = True
Exit Sub
End If
End If
End If
Application.EnableEvents = True
End Sub