I am trying to come up with some code that would take a formula and
edit to put in the ROUND function to round the result to 2 places.
Thank you for any ideas.
I am trying to come up with some code that would take a formula and
edit to put in the ROUND function to round the result to 2 places.
Thank you for any ideas.
Take a look at this article in the archives:
http://groups.google.com/group/micro...browse_thread/
thread/a1c45338385e0fff/0afe4bc0c46218c8
In article <[email protected]>,
[email protected] wrote:
> I am trying to come up with some code that would take a formula and
> edit to put in the ROUND function to round the result to 2 places.
>
> Thank you for any ideas.
If having problems, try http://tinyurl.com/cxupr
--
HTH
RP
(remove nothere from the email address if mailing direct)
"JE McGimpsey" <[email protected]> wrote in message
news:[email protected]...
> Take a look at this article in the archives:
>
> http://groups.google.com/group/micro...browse_thread/
> thread/a1c45338385e0fff/0afe4bc0c46218c8
>
> In article <[email protected]>,
> [email protected] wrote:
>
> > I am trying to come up with some code that would take a formula and
> > edit to put in the ROUND function to round the result to 2 places.
> >
> > Thank you for any ideas.
Range("b1").Formula = "=round(" & Range("A1").Value & ",2)"
would take the value of a1 and round it to 2 places and put the result in b1
--
Gary
<[email protected]> wrote in message
news:[email protected]...
>I am trying to come up with some code that would take a formula and
> edit to put in the ROUND function to round the result to 2 places.
>
> Thank you for any ideas.
>
Thanks Gary, it works on one enty, is there a way I can apply it to a
range of highlighted cells?
I tried the other reference given but I couldn't make it work.
Thanks
see if this works for you
Option Explicit
Dim cell As Range
Sub RoundNumbers()
For Each cell In Selection
cell.Formula = "=round(" & cell.Value & ",2)"
Next
End Sub
--
Gary
<[email protected]> wrote in message
news:[email protected]...
> Thanks Gary, it works on one enty, is there a way I can apply it to a
> range of highlighted cells?
>
> I tried the other reference given but I couldn't make it work.
>
> Thanks
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks