Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I use the code below to force all text to be in upper case. Now I need to
ensure the the number entered in column Q is converted to a time format. The time is always entered in the 24 hour format (18:45 = 6:45 pm, 0645 = 6:45 am) but the often forget the " : ". These cells are not used for calculations, but they still need to be in the proper format. so is there any way to force 1845 to me converted to 18:45 or 645 to 06:45 while ignoring a correctly entered number? Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count 1 Then Exit Sub End If On Error GoTo ErrHandler: If Not Application.Intersect(Me.Range("G7:P2041"), Target) Is Nothing Then If IsNumeric(Target.Value) = False Then Application.EnableEvents = False Target.Value = StrConv(Target.Text, vbUpperCase) End If Application.EnableEvents = True End If ErrHandler: Application.EnableEvents = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert time stored as decimalised number to time format | New Users to Excel | |||
time into a number | Excel Discussion (Misc queries) | |||
Every time i put a number with period it becomes a date and time | Excel Discussion (Misc queries) | |||
calculate/concert long/integer to date time | Excel Programming |