Avoid converting to date when using TextToColumns

renatoab

New Member
Joined
Jun 14, 2009
Messages
32
I have a problem, beacause I import data from text files and some tables come with codes like SEP4, which is converted automatically to date (september 4th).

On Microsoft help pages, one of their suggestions is to put empty space. But it seems to work only when I enter data manualy in a cell. As I use fixed width, I tried to break leaving spaces on the left, but this does not work.
I've already made many things to work this codes, making substitutions, putting characters on the left of the code, but this is not an inteligent way, because I need to treat every case separatelly, and I have many different tables do deal with.

Do you know some way of doing this in a more general and systematic way.

Thank you in advance
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hi

If you are using the usernterface wizard then can you not specify the column to be imported as text on the third screen of the wizard?
 
Upvote 0
I'm not using user interface wizard, I'm using VBA.

There is a parameter fieldinfo, where I can specify the data type of the cell. It is not a simple solution for me, because I need conversion to numeric format, but it seems to be the way I need to follow.
 
Upvote 0
Try recording a macro when you do use the wizard.

Then you should get code with the fieldinfo you want.

Mind you I don't see how you can convert SEP4 to a numeric format as it's text.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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