Solved

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

Posted on 2014-04-24
3
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 52

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

626 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