ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   CSV/Text formatting (https://www.excelbanter.com/excel-discussion-misc-queries/19207-csv-text-formatting.html)

Marcin Gajek

CSV/Text formatting
 
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.



Bob Phillips


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)


"Marcin Gajek" wrote in message
...
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.





Myrna Larson

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.

On Fri, 25 Mar 2005 13:04:05 +0100, "Marcin Gajek"
wrote:

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.




All times are GMT +1. The time now is 11:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com