antiquated excel 2003

krhorner

New Member
Joined
Dec 13, 2011
Messages
5
3 columns A B C
18:00 19:05 65 (Minutes)

Each column is military time and "C" is the total time elapsed in minutes.

Is there there a way to automatically enter the colon and still have excel recognize the entry as time? Currently I format columns A & B as
Number->Custom->h:mm and the Column C as Number -> Custom->
[mm]. I have to manually enter the colon instead of easily typing 1800 or 1905.

If I change the formats in the first two columns to 0":"00, the third column does not recognize the first two columns as time.

I am forced to use Excel 2003 for the compilation of these stats.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
You can Custom Format the cells to

00\:00

Caveat is you'll need to convert the text times to true time values when computing

=TEXT(A1,"00\:00")+0
 
Upvote 0
Or right click and paste this code

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("timeCells")) Is Nothing Then Exit Sub
    If Target.Count > 1 Then Exit Sub
    Application.EnableEvents = False
    With Target
    If Len(Target) = 3 Then .Value = Left(.Value, 1) & ":" & Right(.Value, 2)
    If Len(Target) = 4 Then .Value = Left(.Value, 2) & ":" & Right(.Value, 2)
    Application.EnableEvents = True
    End With
End Sub

Where timecells is a named range that houses times.
 
Upvote 0
Hello, you can type in other column, and in A set a formula:
=CONCATENATE(LEFT(D1,2),":",RIGHT(D1,2))
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,150
Members
448,552
Latest member
WORKINGWITHNOLEADER

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top