Hi all,
I have a little problem converting numbers to hours and minutes with vba.
as for example, i have 583 minutes that would be in hours and minutes 09:43:00.
I tried to convert it with the below code:
Code
Dim rng As Range
Set rng = ActiveSheet.Range("D2:D500").SpecialCells(xlConstants, xlNumbers)
For Each c In rng
If c.Value >= 1 And Int(c.Value) = c.Value Then _
c.Value = Round(c.Value / 60, 2)
Next c
But I get it like this: 9.72
If I try to format the cell, I will get: 17:16:48
Is there any way to adjust it to get it like this: 09:43:00
Greetings.