slope indicator

Converting CR10 Dates to Excel Dates

Excel does not automatically convert the CR10X date format into the Excel format. The date and time output from a CR10X looks like this: 2002,155,1130. (Year, Day of Year, 24 Hour Time).

Excell imports these values into 3 separate cells. The macro below will translate the values into a single cell, which you should format as "date."

The macro

Function cr10date(yy, dd, hhmm)

endlastyear = DateValue("31-December-" + Str$(yy - 1))

dayNow = endlastyear + dd

hh = Int(hhmm / 100)

mm = hhmm - hh * 100

timeNow = TimeValue(Str$(hh) + ":" + Str$(mm) + ":00")

cr10date = dayNow + timeNow

End Function

To enter the macro:

1. Start Excel.

2. Choose Tools>Macro>Visual Basic Editor.

3. From the Visual Basic Editor choose Insert>Module. Copy the function code into the empty window. You need all of the code shown between, but not including, the dotted lines.

4. Choose File>Close to return to Excel.

 

To use the macro:

Apply the macro to a results cell, as shown below. Format the cell as a date, or Excel will display a number.

 

The results of the macro:

If all is correct you should get this: