When I use this:
If a() has numbers with 3 or more decimals, only 2 get put into myRange.![]()
myRange.Value = a()
How can I get all the decimals from an array into a range?
When I use this:
If a() has numbers with 3 or more decimals, only 2 get put into myRange.![]()
myRange.Value = a()
How can I get all the decimals from an array into a range?
Last edited by foxguy; 07-01-2009 at 12:06 PM.
Are you sure it is only pasting two decimal points or is your cell formatted for two decimal points?
It's only pasting 2 decimals. I have the cells formatted for 3 decimals.
might help if you provide a small sample file (with VBA in place) that illustrates the problem in action - I for one can't replicate... ie:
works as expected![]()
Dim a: a = Array(10.234, 11.1) Range("A1").Resize(UBound(a) + 1) = Application.Transpose(a)
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
How did you declare and populate a()? If you assigned a currency formatted range to a, you could get that behaviour.
Everyone who confuses correlation and causation ends up dead.
That's what it was. I populated the array from a range formatted currency 4 decimals.
It bothers me that even though the array had 4 decimals in it, it only pasted 2. Seems like a bug in Excel.
Nah, it's a 'feature'...
You should also be able to use the Value2 property to get doubles passed to the array instead.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks