Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Move a value from one range to another - rounding occurs that I do not want....?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
monkmanusa@gmail.com - 31 May 2006 19:25 GMT
Hello all,
I have some pretty simple code that is trying to move the "value" from
one range to another.....each range happens to be a single cell. Each
cell has been formatted in the worksheets to be number format
$#,##0.000000 (i.e. six decimals - yes I am dealing with fractions of a

penny)......
Now lets say the value in the rFromRange is equal to $3.235765, I then
(in code) set the value of the rToRange to be equal to the value in the

rFromRange.....but what I end up with in the rToRange is $3.240000.....

I have tried EVERYTHING....I have even tried getting the number format
from the "from" range and applying it to the "to" range....but to no
avail.....the number in the result ends up always being rounded to 2
decimals....and I am beginning to pull my hair out......

Anyone any ideas?

Code is pretty straight forward (I have simplified this a bit - but the

basics are there...)

Dim rFromRange as Range, rToRange as Range
set rToRange as Range("whereitsgoing")
set rFromRange as Range("whereitsfrom")
rToRange.Value = rFromRange.value

Please help
Thanks,
Monkman.
Dave Peterson - 31 May 2006 21:12 GMT
Try:

rToRange.Value2 = rFromRange.value2

.value2 is nice when you're dealing with currency or dates.

> Hello all,
> I have some pretty simple code that is trying to move the "value" from
[quoted text clipped - 27 lines]
> Thanks,
> Monkman.

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.