Text To Columns

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
2,056
Office Version
  1. 365
Platform
  1. Windows
I have 130 odd columns of data. two hold dates and two need not be imported. when I try to specify only the changes to these four columns i do not get the results i want. I have tried playing around with it but can get nothing else to work than listing each field. so, i broke it down and tried skipping the first column i don't want (column 7) and it gets rid of column 5.

Code:
With ActiveWorkbook.Sheets(1)
   Columns("A:A").TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
        Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
        :=Array(Array(7, 9))

my first two fields are numeric and then the rest have text qualifiers (double quotes).

any ideas folks?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
You've posted some code that I'm presuming does *not* do what you want to do... what *do* you want to do??
 
Upvote 0
i want to parse all fields except 7 and 121, and convert field 6 to date format (DMY). from my understanding, you do not need to list every field only those that you wish to change. all others willl default to text. so, in my initial post, and i should have been specific, i wish to change only 4 of the 136 fields: two will be skipped (7 and 121) and two to be formatted as date. however, using the correct format and specifying only the four fields, my results were not correct. first error was that column 5, not seven was skipped. this was one of the date fields i needed. thats when i started playing around with it. my test code, in my initial post, kept removing field 5, not 7, even though it states 7. what i want to know is what could be causing this? are there other factors, maybe in the content of the fields to be parsed, that could affect the count. the raw data is a comma delimited csv from one of our systems.
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,789
Members
452,942
Latest member
VijayNewtoExcel

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