Rounded-off number

  • Thread starter Thread starter herve
  • Start date Start date
H

herve

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

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