CSV leading zeroes

D

Doyle F

I create csv files from another application and send them
to users. If a column has leading zeroes, Excel removes
them. Is there a way to get Excel not to remove leading
zeroes in columns when opening up CSV files.
Example:
test.csv looks like this
Name,BadgeNumber
"Tom Smith","123456"
"Mary Jones","00654"
 
J

J.E. McGimpsey

Doyle F said:
I create csv files from another application and send them
to users. If a column has leading zeroes, Excel removes
them. Is there a way to get Excel not to remove leading
zeroes in columns when opening up CSV files.
Example:
test.csv looks like this
Name,BadgeNumber
"Tom Smith","123456"
"Mary Jones","00654"

Change the extension from .csv to .txt and when you open the file,
use the Text Import Wizard - in the third pane, click on the second
column and select the Text radio button.

You can record a macro of this if you wish - post back if you need
help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top