Rounding

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

Time1 = Lastcell * 12 / 60 / 60

Thanks in advance!

Aaron
 
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.
 

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