leading zeros lost when opening a .csv file

B

Bob Vollmer

I am looking for a way to let Excel know that zip code in
a .csv file should be treated as text. Excel treats a
zipcode as a number and discards any leading zeros.
I have tried the following methods to no avail:

A blank before or after the zipcode (they are discarded)
Chr$(0)s are discarded too

A single quote prefixed to the zipcode (works but is left
in the field)

Is there a way to let Excel know that a value is actually
text in a .csv file?
 
P

Paul S

When you open the .csv file Excel probably just opens it
up automatically (not too sure on this can't remember).
If it does, change the .csv to a .txt file and go
file/open in Excel and open the .txt file. This will
bring up the import wizard. Click through the screens
maaking sure you select "comma" as the deliminator. On
the last screen it will give you the option of changing
the format of the individual columns, change the zip code
column to text.

Paul
 

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