ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Format Cell as Time (https://www.excelbanter.com/excel-programming/394563-format-cell-time.html)

[email protected]

Format Cell as Time
 
Hello

i have this bit of code that i would like it to format as time when
the value is added to the cell

ActiveCell.Offset(0, 7).Value = Round(CallmediaAveHandlingHours /
NumberofWeekstoSummary, 2)

The CallmediaAveHandlingHours value is a total time taken from several
different worksheets.

Many Thanks

Stuart


[email protected]

Format Cell as Time
 
easier then i thought

ActiveCell.Offset(0, 7).Value =
Format(Round(CallmediaAveHandlingHours / NumberofWeekstoSummary, 2),
"Long Time")

Thanks


JE McGimpsey

Format Cell as Time
 
One way:

With ActiveCell.Offset(0, 7)
.Value = Round(CallmediaAveHandlingHours / _
NumberofWeekstoSummary, 2)
.NumberFormat = "[hh]:mm"
End With



In article . com,
wrote:

Hello

i have this bit of code that i would like it to format as time when
the value is added to the cell

ActiveCell.Offset(0, 7).Value = Round(CallmediaAveHandlingHours /
NumberofWeekstoSummary, 2)

The CallmediaAveHandlingHours value is a total time taken from several
different worksheets.

Many Thanks

Stuart



All times are GMT +1. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com