leading zeros lost when opening a .csv file

  • Thread starter Thread starter Bob Vollmer
  • Start date Start date
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?
 
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
 
Back
Top