Sunjinsak
Board Regular
- Joined
- Jul 13, 2011
- Messages
- 151
- Office Version
- 365
- 2019
- 2016
- 2013
- Platform
- Windows
Hi,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
I want to convert, if possible, a time expressed as a decimal value to hours and minutes in VBA.
<o></o>
Is there a way I can do this programmatically?
<o></o>
Just as a little background the calculation is to work out TOIL (Time Off In Lieu) and has to be performed in decimal hours.
<o></o>
The initial calculation is no problem, but I want to convert the results (expressed in decimal time) to standard HH:MM format to display to the end user.
<o></o>
For example:
7.4 hours = 7 hours and 24 minutes
9.5 hours = 9 hours and 30 minutes
5.02 hours = 5 hours and 1 minute
<o></o>
Also, for reasons too long to go into here, I have to use VBA. I can’t pass the results to an underlying worksheet and have Excel convert them, nor can I use Excel to do the calculations in the first place.
<o></o>
Can anyone help me with this?
<o></o>
Thanks in advance.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
I want to convert, if possible, a time expressed as a decimal value to hours and minutes in VBA.
<o></o>
Is there a way I can do this programmatically?
<o></o>
Just as a little background the calculation is to work out TOIL (Time Off In Lieu) and has to be performed in decimal hours.
<o></o>
The initial calculation is no problem, but I want to convert the results (expressed in decimal time) to standard HH:MM format to display to the end user.
<o></o>
For example:
7.4 hours = 7 hours and 24 minutes
9.5 hours = 9 hours and 30 minutes
5.02 hours = 5 hours and 1 minute
<o></o>
Also, for reasons too long to go into here, I have to use VBA. I can’t pass the results to an underlying worksheet and have Excel convert them, nor can I use Excel to do the calculations in the first place.
<o></o>
Can anyone help me with this?
<o></o>
Thanks in advance.