View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
MattM
 
Posts: n/a
Default Stop Excel from stripping out leading zeros when saving as CSV

Hi, I am getting strange behaviour from Excel when working with CSV files.

It's quite easy to reproduce the problem:
1) In a text editor, such as Notepad, create the file "test.csv", containing
this data:
001,hello
2) Close the file
3) Open the same file up in Excel and change the value in B1 to "goodbye"
4) Save, clicking "Yes" when Excel asks if I want to keep CSV format, and
close Excel
6) Open the file in the text editor. It now contains:
1,goodbye

In other words, Excel has decided that "001" should be saved as "1". Is
there any way to stop this?
Regards
Matthew