I have code that creates a csv mailing list for use in Excel 2013. My problem is that when the csv is clicked to open in Excel, the leading zero on zip codes is removed.
In older versions of Excel, you could add a single quote to denote that the cell should be treated as a string, but in the newer versions, the single quote is included. I've also tried double quotes and enclosing the zip code in single and double quotes with no luck.
I know that you can change the csv to a text file, and then manually import it into Excel, setting the zip column as a text column, but I would prefer make it easier on the end user.
Is there a way to import a number as a string from a csv in Excel 2013?
EDIT: As stated in the comments above, there is also a solution on the exporting side.
Instead of just opening the .csv-file with excel, have you tried a import, using Data > Import external Data > From Text?
There you will have to option to select a dedicated text qualifier, that can be your single quote '
Just make sure to choose Text as column type for the column, you need leading zeros in.
This would be the result:
Sorry for the german screenshots, but you live where you live. ;-)