Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

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

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
mgmhicks
Asked:
mgmhicks
2 Solutions
 
Rory ArchibaldCommented:
Try using:
Sheets("MergeRecords").Cells(n, 3).Value = "'" & myArray(2)

Open in new window

0
 
Rgonzo1971Commented:
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
 
mgmhicksAuthor Commented:
Both Solutions worked great
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now