CSV file format changes format on opening

BensTooCool

New Member
Joined
Nov 18, 2014
Messages
10
Hi,

I have a dataset that I currently save as a csv file, one column in particular is causing me a bit of a headache. In column C I have a first line of an address field with a number of addresses that have just a flat number such as 4422.

When I save the file in csv format via a VBA macro the formatting of this field is fine but if I then close the file and reopen it then those values in column C with the flat numbers has been converted to a date column.

How can I prevent this from happening and keep that column as a text column??

Thanks,

Ben
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
There is nothing wrong with the CSV file. The issue is that you are trying to use Excel to view it!
You should NEVER use Excel to view the contents of CSV files, as Excel does its own conversions on the data when you open it, so you do not see the data as it really exists in the CSV file.
You should use a Text Editor look NotePad to view the CSV file if you want to see what the data in it really looks like.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top