"5E11" in excel displays as 500000000000 or 5e11 which is the numeric scientific notation. How can I tell Excel to display 5E11 as a string "5E11"?
Thanks
Sunil
I found the solution. I made sure that I put the following value in the cell:
="5E11"
The double quotes should be there and part of the string. Then Excel will automatically remove the = sign and also the leading and trailing double quotes, and treat 5E11 as a string and not a numeric. This solved my problem.
Preceding 5E11 by a single quote works but then Excel includes the single quote as part of the value, so Excel thinks the value is '5E11 rather than just 5E11. So I think the single quote approach may not be an appropriate solution here.
Thanks
Sunil
Sub Testing()
Dim sSomeValue As String
sSomeValue = "'5E11"
Worksheets.Add
Range("A1").Value = sSomeValue
MsgBox Range("A1").Value
End Sub
...Preceding 5E11 by a single quote works but then Excel includes the single quote as part of the value, so Excel thinks the value is '5E11 rather than just 5E11. So I think the single quote approach may not be an appropriate solution here.
Thanks
Sunil
Actually, I tested the single quote and also the double quote approach, and found the extra characters of single quote and double quote show up when the cell is in edit mode. But when cell is not in edit mode then the single quote or double quote do not show up. Please look at this video to see what I am saying : http://screencast.com/t/r4aq0ur6
So it seems those extra characters are not ignored completely by Excel.
You know why in edit mode these extra characters show up?
Thanks
Sunil
I guess Excel acts strange sometimes.
So do you suggest just using a single quote at start of such a string, when exporting ? I am exporting data to a tab delimited file using C# code.
Thanks
Sunil