Hi
I try to round a bunch of numbers like 832.3536367 to 832. So I want get rid of the decimals not just formatting to show less decimals
I want to do this in a macro by using a loop to go through each cell in a column until there are no more entrys (and it should carry on if the cell is empty) I've come up with the code below but this doesn't cut it even if all cells are NOT empty
Column A is filled with ref numbers like 1,2,3,4 etc
Column b is filled with the values like 4.1468 ; 540.4844; 1001.8811
Thanks in advance
Science boy
Sub roundnumbers()
Dim number As Integer
Dim number2 As Integer
i = 1
Do
Cells(i + 1, 2).Value = number
number2 = Round(number, 0)
Cells(i + 1, 2).Value = number2
i = i + 1
Loop Until Cells(i + 1, 1).Value = ""
End Sub
Bookmarks