CSV/Text formatting

  • Thread starter Thread starter Marcin Gajek
  • Start date Start date
M

Marcin Gajek

Hello

I have Excell 2003 on WinXP Home edition.
In column A1 I have value 107, I need 00107 and i need it saved in .CSV
format. I'm converting columns to TextFormat
and excel accepts it but when i want to save it in Csv format i say
something about loosing some formatting. I HAVE to
save file in CSV format with values in column A 00107 not 107...please help
me !

Thank you.
 
For Each cell In Range("A1", Range("A1").End(xlDown))
cell.NumberFormat = "@"
cell.Value = Format(cell.Value, "00000")
Next cell


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
If the cell is formatted as text and contains the txt 00107, it WILL be
exported that way. You can check that is you open the file in Notepad or
Wordpad. The the leading zeroes are lost when you OPEN the CSV file in Excel.
With the CSV format, you have no control over the format of the columns. To
get around this, you should save the file as TEXT with a tab delimiter. Then,
when you open it again, you get the Text File Wizard and can specify that this
column is text.
 

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

Back
Top