ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   retain leading zeros when importing (https://www.excelbanter.com/excel-discussion-misc-queries/58806-retain-leading-zeros-when-importing.html)

LeePotts

retain leading zeros when importing
 
I am importing several thousand records from a web based database into excel.
I have to combine some records and then dump the data into another database.
The dataset set contains part numbers with leading zeros.

How do I get Excel to retain the leading zeros? I've read numerous posts on
how to change the cell format to display a leading zero, however, the actual
cell value does not inlcude this zero and I need it retained for import into
the next database. I've tried saving the HTM as a text file and importing,
however, the file is not delimited and the cell lenght varies so this is a
non-starter.

David McRitchie

retain leading zeros when importing
 
Hi Lee,
Change the file extension from .csv to .txt so that the text import wizard comes
up which will give you a chance to indicate that the column is to be text.

If that does not work then prefix the data with a letter, and remove the prefixed
letter form the column once in Excel after you set up the format the way you wnat it.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"LeePotts" wrote in message ...
I am importing several thousand records from a web based database into excel.
I have to combine some records and then dump the data into another database.
The dataset set contains part numbers with leading zeros.

How do I get Excel to retain the leading zeros? I've read numerous posts on
how to change the cell format to display a leading zero, however, the actual
cell value does not inlcude this zero and I need it retained for import into
the next database. I've tried saving the HTM as a text file and importing,
however, the file is not delimited and the cell lenght varies so this is a
non-starter.





All times are GMT +1. The time now is 02:45 AM.

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