ExcelChampion
Well-known Member
- Joined
- Aug 12, 2005
- Messages
- 976
Something that I've worked around for years, and finally want to fix is, when a formula returns a number that extends out to more than two decimal places, the following code ends up rounding the number to the nearest hundredth, where rng is an array:
Range(rng).value = Range(rng).value
Over the years I've experimented with creating a Variant data type, as in:
Dim myDec as Variant
myDec = Range(rng).value
Range(rng).value=myDec
But to no avail...
The only thing that I know that works is using the Copy/PasteSpecial method, but I don't like commandeering the user's clipboard to do stuff for obvious reasons.
What is the best process for returning the value from a formula and retaining its precision? Anyone try the sub-data type, Decimal?
Thanks.
Range(rng).value = Range(rng).value
Over the years I've experimented with creating a Variant data type, as in:
Dim myDec as Variant
myDec = Range(rng).value
Range(rng).value=myDec
But to no avail...
The only thing that I know that works is using the Copy/PasteSpecial method, but I don't like commandeering the user's clipboard to do stuff for obvious reasons.
What is the best process for returning the value from a formula and retaining its precision? Anyone try the sub-data type, Decimal?
Thanks.
Last edited: