View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
witek witek is offline
external usenet poster
 
Posts: 69
Default A visual basic value copy BUG?? - accounting format has copyproblem!!

wrote:
I just got an unbelievable behavior from excel when i did the following
value copying:
-----------------------------
Sub mycopy()
Range("A2:B2").Value = Range("A1:B1").Value
End Sub
-----------------------------

I formatted cell A1 as accounting format (or currency format $) and
input $0.0123 in A1.
format cell B1 as general format and input 0.0123 into B1.

After running the macro, you'll see the target values of A2 becomes
$0.0100, B2 is 0.0123. (i'm using excel 2003)

THe accounting/currency format just use the rounding automatically!!!
Is this a bug? or a feature?

BTW, i tried after to use ".copy" and ".PasteSpecial xlPasteValues",
that works regardless. But not knowing the limit of range copy made
million dollar difference in my analysis! DARN it!



I have the same. Definitely it's a bug.