ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Rounding (https://www.excelbanter.com/excel-programming/302796-rounding.html)

Aaron

Rounding
 
I have this code and I need to Round Time1 to two dec places.

Time1 = Lastcell * 12 / 60 / 60

Thanks in advance!

Aaron

Nigel

Rounding
 
Time1 = Round(Lastcell * 12 / 60 / 60,2)

Cheers
Nigel

"Aaron" wrote in message
...
I have this code and I need to Round Time1 to two dec places.

Time1 = Lastcell * 12 / 60 / 60

Thanks in advance!

Aaron




JE McGimpsey

Rounding
 
One way:

Time1 = Round(Lastcell/300, 2)

or, for MacXL/WinXL97:

Time1 = Application.Round(Lastcell/300,2)


Note the VBA's round works slightly differently than XL's ROUND(),
rounding a value ending in 5 to the nearest even number, rather than
always away from zero.

In article ,
"Aaron" wrote:

I have this code and I need to Round Time1 to two dec places.

Time1 = Lastcell * 12 / 60 / 60

Thanks in advance!

Aaron



All times are GMT +1. The time now is 10:07 AM.

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