Time conversion

  • Thread starter Thread starter Maxi
  • Start date Start date
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
 
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

(e-mail address removed)
(e-mail address removed) with @tiscali.co.uk
 
You're very welcome.

--
Regards

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

(e-mail address removed)
(e-mail address removed) with @tiscali.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top