Solved

string "0E302" turns into 0.00E+00 when copied to another cell

Posted on 2014-04-24
3
244 Views
Last Modified: 2014-04-24
I have a string array with shows "0E302" as the value.  However when I do a Sheets
("MergeRecords").Cells(n, 3) = CStr(myArray(2)) 

Open in new window

it ends up on the other sheet as 0.00E+00.

Here is the code to get the information into the array
myArray = Split(ResidentID, "-")

Open in new window


they all seem to be strings at this point.  Anyone have any ideas.

thanks
0
Comment
Question by:mgmhicks
3 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 250 total points
ID: 40020496
Try using:
Sheets("MergeRecords").Cells(n, 3).Value = "'" & myArray(2)

Open in new window

0
 
LVL 50

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 250 total points
ID: 40020511
Hi,

Or format the cell as Text

Sheets("MergeRecords").Cells(n, 3).NumberFormat = "@"
Sheets("MergeRecords").Cells(n, 3) = myArray(2)

Open in new window

Regards
0
 

Author Closing Comment

by:mgmhicks
ID: 40020529
Both Solutions worked great
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question