
Now begin entering times (3:45 or 1:12) in the Named Range with ONE EXCEPTION! Instead of time format, enter them as decimals and press enter.Note that you may omit the named range if you have chosen to use cell references. In your Worksheet, select a range of cells and assign them the name ("myTimes").

Also, if on a network, you may need IT's help. If it's not selected, select it and hit OK.
Decimal time converter excel template code#
Right click on the sheet tab and choose View Code and paste the code in the panel.First, paste the code in the WorkSheet module.Target = Evaluate("=dollarde(" & Target & ",60)") If Intersect(Target, Range("myTimes")) Is Nothing Then Exit Sub Private Sub Worksheet_Change(ByVal Target As Excel.Range) So when 3hrs 45min is entered, it will be changed to 3.75 hrs. Here we will enter the time with a simple difference and the code will convert the entry automatically, IN THE SAME CELL. The usual way times are used is to be entered as 3:45 (3hrs 45min) and then the result is multiplied by 24 with the result formatted as General, to produce 3.75.

It can be used in timesheets and other applications where time is used and calculations of total hours are needed.

The procedure uses DOLLARDE from the Analysis ToolPak to convert hours and minutes (3:45) to decimal hours (3.75) on the fly. Converting hr:min to Decimal Hours on the Fly
