ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   csv file truncating zero values (https://www.excelbanter.com/excel-programming/427104-re-csv-file-truncating-zero-values.html)

Patrick Molloy[_2_]

csv file truncating zero values
 
this
000999
isn't a number. It's text
when you open a CSV, clever ol' Excel will check the text, recognise it as a
number, and thus changes the type for you, whether you want it to or not.
If you open the CSV in Notepad, you'll see it saved as 000999
So you need to format the cell or column/row as text.
Alternative would be to read in the values from the text file and place them
into a workshheet as text.


"JP" wrote:

When I open a csv file and change contents on the first row via excel,
numbers such as 000999 are saved as 999. I need to change column headings
on the first row of my csv file and save it while preserving the number
formatting below it. Can this be accomplished using the Write or Print
statement via vba? At present, I am opening it and saving it with Excel.






All times are GMT +1. The time now is 05:28 PM.

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