Madara
New Member
- Joined
- Jan 6, 2015
- Messages
- 13
Hello,
I'm trying to round off to 0 decimal places a range of cells using VBA.
Here is my code
But i'm getting run time error 1004.....
Any help? I'm very new to VBA.
Thanks
I'm trying to round off to 0 decimal places a range of cells using VBA.
Here is my code
Code:
Sub roundOff()
For Each cell In Range("G58:J63,G65:J70,G72:J83,G85:J110,G112:J119,G121:J126,G128:J145,G147:J150,G152:J175,G177:J179,G181:J192,G194:J196,G199:J201,G203:J203,G205:J205,G207:J209,G211:J216,G218:J226,G228:J230,G232:J234,G236:J236,G238:J268,G270:J275,G277:J281,G283:J286,G288:J291,G293:J298,G300:J305,G307:J310")
If cell = "" Then Exit Sub
cell.Value = WorksheetFunction.Round(cell.Value, 0)
Next cell
End Sub
But i'm getting run time error 1004.....
Any help? I'm very new to VBA.
Thanks
Last edited: