CSV file

G

Guest

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).
 
H

Harlan Grove

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.
 
G

Guest

Thank you, I will give it a try.

Harlan Grove said:
mcorley wrote...

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.
 
B

Beege

mcorley,

I believe it does save the 5 decimal places in th CSV file, but when youy
open it again with excel, excel drops it off again.

Try saving as CSV, open with Notepad and see what you get...


Beege
 

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