Solved

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

Posted on 2014-04-24
3
233 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
Comment Utility
Try using:
Sheets("MergeRecords").Cells(n, 3).Value = "'" & myArray(2)

Open in new window

0
 
LVL 48

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 250 total points
Comment Utility
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
Comment Utility
Both Solutions worked great
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now