LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Rounding range of cells



"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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cells Rounding up but shouldn't be myssieh Excel Discussion (Misc queries) 1 March 3rd 08 05:07 PM
Move a value from one range to another - rounding occurs that I do not want....? [email protected] Excel Programming 1 May 31st 06 09:12 PM
Rounding a large range & a Missing Font Jay New Users to Excel 1 May 21st 06 06:50 PM
How to apply rounding across a range of cells with other formulae Steve T Excel Worksheet Functions 1 October 20th 05 07:39 PM
Rounding Entries From Range to Array [email protected] Excel Programming 7 October 5th 04 08:41 PM


All times are GMT +1. The time now is 09:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"