ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Importing Long Numbers as Text cells (https://www.excelbanter.com/excel-discussion-misc-queries/258643-importing-long-numbers-text-cells.html)

Steve

Importing Long Numbers as Text cells
 
I want to import a text file with some long numbers (16 characters and more).
Excel automatically converts them to floating point numbers which causes it
to lose some digits of precision. When I put quotes around the numbers excel
treats it as text but leaves the quotes around the number and removing the
quotes causes it to covert to floating point even if the format for the cell
is TEXT. If during the import I specify the columns as TEXT everything is
fine. However I need to do this for many files and many columns and I need
do the process many times on an on going basis. Is there anyway to automate
this?
--
Steve

Dave Peterson

Importing Long Numbers as Text cells
 
If the layout of the data is always the same, then you could record a macro when
you do it once and rerun it for all the other files.

If you need help modifying the code, post back with your question and I bet
you'll get help.

Steve wrote:

I want to import a text file with some long numbers (16 characters and more).
Excel automatically converts them to floating point numbers which causes it
to lose some digits of precision. When I put quotes around the numbers excel
treats it as text but leaves the quotes around the number and removing the
quotes causes it to covert to floating point even if the format for the cell
is TEXT. If during the import I specify the columns as TEXT everything is
fine. However I need to do this for many files and many columns and I need
do the process many times on an on going basis. Is there anyway to automate
this?
--
Steve


--

Dave Peterson


All times are GMT +1. The time now is 12:28 PM.

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