MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Importing CSVs

Posted by Richard Gokool on April 30, 2001 12:10 PM


I was wondering if there was a way to modify the way Excel imports a CSV. My problem is that the data from my DB is always exported as a CSV but when I import this same file i lose all the leading zeros. The leading zeros are present in the exported csv but, i guess, Excel then converts the columns with the "general" Tab on instead of the text. Excel imports in one step so my question is:

IS there a way to modify the automatic CSV import program in Excel?

The only solution I have found is to eliminate the extension and import it the long way.

any help would be greatly appreciated.

Posted by Kevin James on April 30, 2001 12:46 PM

Hello Richard,

change the file to .txt extension

during import, designate column as text.

Hope this helps.


Posted by Richard on May 01, 2001 7:48 AM

Thanks for the reply Kevin. Right now, I'm doing something similar by just removing the CSV extension and importing as a text. I was just wondering if there was a way to modify the default csv import. The program i have in place exports the csv from my database and launches it into Excel automatically. I probably should have mentioned that earlier. I guess I'll just have to write a macro that renames the file and import it that way.

Thanks again for your help and, if you think of a simpler way to do this, please write.