Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Tim Williams" wrote: I'm not sure how a UDF would be more convenient than just using a macro Sub tt() Dim c As Range For Each c In Selection.Cells c.Value = Round(c.Value, 0) Next c End Sub Tim On Nov 13, 4:50 pm, ACCA wrote: Does anyone know of a way to round a range of cells without doing it column by column with the round function. For eg if all the numbers are in the format 150.30 (to 2 dp) and we would like to round each to 150 (0 d.p). Can a UDF etc be created to do this? If yes does anyone know how to do this? Thanks in advance. . Hi Tim/Rick, Thanks guys for your prompt response. Tim, I am an intermediate Excel user so I am not that exposed to VBA even though I have bought some books and am reading. You are also right a UDF would probably not be best. Can I just put the code you supplied in a vba module and it will work or is it just a reference for me to try and create the code.? Rick, sorry if I did not explain the situation properly. I am looking for something to change the cellls not just formatting. Hope this clarifies. In the meantime I will also be reading my books as well to see if I can come up with something. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cells Rounding up but shouldn't be | Excel Discussion (Misc queries) | |||
Move a value from one range to another - rounding occurs that I do not want....? | Excel Programming | |||
Rounding a large range & a Missing Font | New Users to Excel | |||
How to apply rounding across a range of cells with other formulae | Excel Worksheet Functions | |||
Rounding Entries From Range to Array | Excel Programming |