Time conversion

M

Maxi

In A1 I have the value 60 I want it in 1:00:00 format
What I do is, I divide that by A1/24*60 and the copy that and paste-
special-value on A1

Is there any way to convert the number 60 into 1:00:00 format without
having to do calculation in temporary columns?

Maxi
 
S

Sandy Mann

Maxi,

Are you sure about your formula? With 60 in A1 your formula gives me
3600:00:00 formatted as "h:mm:ss" =A1/(24*60) returns "1:00:00"

Will a macro do? If so select all the cell that you want to convert and run
the following Macro:

Sub ConvertTime()

With Selection
For Each cell In Selection
cell.Value = cell.Value / 24 / 60
Next cell

.NumberFormat = "h:mm:ss"

End With
End Sub

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

[email protected]
[email protected] with @tiscali.co.uk
 
Top