ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Rounded-off number (https://www.excelbanter.com/excel-programming/344645-rounded-off-number.html)

herve[_12_]

Rounded-off number
 

Hello all,
does anyone know how in VB to make the rounded-off number.
If I have in Cell A1 "1", I want "10"
If I have in Cell A2 "8", I want "10"
If I have in Cell A3 "12", I want "20"
If I have in Cell A4 "119", I want "120"
If I have in Cell A5 "1015", I want "1020"
If I have in Cell A6 "110", I want "110"
If I have in Cell A7 "111", I want "110"
....

Thanks in advance

Herve


--
herve
------------------------------------------------------------------------
herve's Profile: http://www.excelforum.com/member.php...o&userid=27314
View this thread: http://www.excelforum.com/showthread...hreadid=481937


Carlos[_6_]

Rounded-off number
 
Hi Herve

try ceiling function with significance 10

ex if cell a4

sub Rounded()
dim oCell as Range
set oCell=Range("A4")
Val_round= Application.WorksheetFunction.Ceiling(oCell, 10)
end sub

"herve" wrote in
message ...

Hello all,
does anyone know how in VB to make the rounded-off number.
If I have in Cell A1 "1", I want "10"
If I have in Cell A2 "8", I want "10"
If I have in Cell A3 "12", I want "20"
If I have in Cell A4 "119", I want "120"
If I have in Cell A5 "1015", I want "1020"
If I have in Cell A6 "110", I want "110"
If I have in Cell A7 "111", I want "110"
...

Thanks in advance

Herve


--
herve
------------------------------------------------------------------------
herve's Profile:
http://www.excelforum.com/member.php...o&userid=27314
View this thread: http://www.excelforum.com/showthread...hreadid=481937





All times are GMT +1. The time now is 11:13 PM.

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