ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   scientific notation to text formatting question (https://www.excelbanter.com/excel-programming/287756-scientific-notation-text-formatting-question.html)

dtdd

scientific notation to text formatting question
 
I have a string that looks like "92343E102".
When I assign it:
Worksheet.Cells(outrow, 3) = strTest

Excel converts the string to scientifc notation "9.23E+106"

how do I presrve the string the way it is?

Thanks

Chip Pearson

scientific notation to text formatting question
 
Set the format of the cell to text prior to assigning it a value.
For example,

Worksheet.Cells(outrow, 3).NumberFormat = "@"
Worksheet.Cells(outrow, 3) = strTest



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"dtdd" <dd@eer wrote in message
...
I have a string that looks like "92343E102".
When I assign it:
Worksheet.Cells(outrow, 3) = strTest

Excel converts the string to scientifc notation "9.23E+106"

how do I presrve the string the way it is?

Thanks




dtdd

scientific notation to text formatting question
 
Chip Pearson wrote:
Set the format of the cell to text prior to assigning it a value.
For example,

Worksheet.Cells(outrow, 3).NumberFormat = "@"
Worksheet.Cells(outrow, 3) = strTest



It solved the problem.

Thanks


All times are GMT +1. The time now is 12:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com