Excel is automatically converting my text to a date(csv file)

avishain

Board Regular
Joined
Dec 14, 2010
Messages
75
Hello there,

im using excel 2007 and ive got the following problem:

column T (formated as general but i can format it as text if have to) consist of street numbers ,for instance :

15/7

when i import the excel file to csv file (by using VBA) ,excel shows this number as date ( july-15).

how can i fix that?

thanks
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
when i open it in notepad i see:

15/07 (instead of july-15 as i see in the csv file itself)

it happens also when i enter 15-7 (instead of 15/7)

the code for saving as csv is :

ThisWorkbook.SaveAs "c:\" & Format(Now, "ddmmyyyyhhmm") & ".csv", xlCSV, local:=True
ThisWorkbook.Close False
End Sub
 
Upvote 0
If you open the CSV-file in Excel, its auto-convert routines already kick-in. Try to open it in Notepad or Wordpad... what does it show there?

I think you will have to format the cells first to Text format, then enter the data, then save as CSV... not tested that though.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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