Thread: CSV file
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default CSV file

mcorley wrote...
My excel worksheet options are set to display 0.41200 (5 decimal places).
How can I keep this formatting when I save as a csv file? (I keep losing the
zeros).


You'd need to convert all these numbers to text. You could create a new
worksheet and enter formulas in that worksheet like

A1:
=IF(ISNUMBER(OriginalWS!A1),TEXT(OriginalWS!A1,"0. 00000"),OriginalWS!A1&"")

Fill that worksheet with these formulas, then save it instead of your
original worksheet as the CSV file. The only other alternative is
writing a macro to write the CSV file using VBA file I/O statements.
The mirrored worksheet changing numbers to text is easier.

That said, you'd need to reformat these numbers when you open the CSV
file. There's NO WAY to save formatting information in CSV files.