LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 3
Question Small Decimal Won't Copy

I already have a workaround, but would like to understand why this was a problem (Excel 2007):

I have VBA code that is supposed to copy a row of numeric values into a corresponding range of cells in another worksheet.

Range("D13:P13").Cells(x).Value = cel.Offset(0, x).Value

I just found, though, that when one of the cells contains .0010, it comes across as .0000.

Both cells have the same number format, so I am nonplussed at this. My workaround, which solved the problem, is:

Range("D13:P13").Cells(x).Value = Val(CStr(cel.Offset(0, x).Value))

Somehow, casting the original value to a string, then back to a numeric value, makes it come out as .0010 as it should.

WHY was it not coming across correctly in the first place?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
large file - copy and paste small group CHEL294 Excel Discussion (Misc queries) 2 June 4th 09 09:08 PM
ISERROR,SMALL,INDEX, MATCH, SMALL?? M.A.Tyler Excel Discussion (Misc queries) 1 May 2nd 07 04:08 AM
HOW DO I COPY & PASTE A SMALL INFO FM AN XL TO THE CELL COMMENT RAGHAV Excel Worksheet Functions 0 May 3rd 06 03:17 PM
Office 2000-Small Business, XCEL eror = copy/paste error Ed-BlanksUSA Excel Discussion (Misc queries) 0 February 7th 06 08:49 PM
i have lost the small + that allows mass copy of formulas in excel Brendan Excel Discussion (Misc queries) 1 January 17th 06 03:29 AM


All times are GMT +1. The time now is 07:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"