Manipulating Round() function in VBA

my-lew

New Member
Joined
Jan 7, 2004
Messages
2
Is it possible to specify how you want a number to be rounded. ie: nearest hundeth, thousanth, ten thousanth, ect.......

given_______want

45570______45600

:unsure:
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Welcome!

When you use the round function, you need to input a formula in the following format:

=round(number, number of digits)

The "number of digits" specifies how many decimals to round to, as follows:

2 = 2 decimal places
0 = 0 decimal places
-1 = nearest 10
-2 = nearest 100
-3 = nearest 1000

You can also use "ceiling" formala for odd rounding, or roundup or rounddown

:biggrin:
 
Upvote 0
Hello my_lew:

One of the ways to do this would be to use the worksheet function ROUND ... if the entry 45570 is in cell A1, then using the following
Code:
worksheetfunction.RoundUp([a1],-2)
you can get the result as 45600

I am using EXCEL 97 and I seem to have access to the ROUND function only through the worksheet environment.
 
Upvote 0

Forum statistics

Threads
1,215,039
Messages
6,122,799
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top