I am simply trying to round numbers up or down.
Example if the numbers are: 49.6, 38.7 they need to be 49 and 38
For the round up it would be the opposite 50 and 39.
I can't get the roundup and rounddown function to work in the macro, i don't
know why? the round function seems to work but it doesn't do it correctly.
this is what I have so far...
Sub RoundUp()
SRow = ActiveCell.Row
SCol = ActiveCell.Column
RH = SCol - 4
FinalRow = Range("A65536").End(xlUp).Row
For i = SRow + 1 To FinalRow
If Cells(i, RH).Value <> 0 Then
Cells(i, SCol).Value = Round(Cells(i, RH), 0)
End If
Next i
End Sub
Thanks,
Lino
Example if the numbers are: 49.6, 38.7 they need to be 49 and 38
For the round up it would be the opposite 50 and 39.
I can't get the roundup and rounddown function to work in the macro, i don't
know why? the round function seems to work but it doesn't do it correctly.
this is what I have so far...
Sub RoundUp()
SRow = ActiveCell.Row
SCol = ActiveCell.Column
RH = SCol - 4
FinalRow = Range("A65536").End(xlUp).Row
For i = SRow + 1 To FinalRow
If Cells(i, RH).Value <> 0 Then
Cells(i, SCol).Value = Round(Cells(i, RH), 0)
End If
Next i
End Sub
Thanks,
Lino