text to column macro

G

Guest

I am trying to use the text to column tool on over 1200 seperate rows. How
can I make the macro do this? I tried to "record" but it uses the specific
to the original cell information. I need it to say "active cell" then
actually run the formula that is text to column for what ever is in the
current cell. Any body have any ideas. Thanks in advance - this project is
huge and this is only the begining.
 
G

Guest

You can run the "TextToColumn" feature on an entire column by first
highlighting the entire column, then doing Data > TextToColumns > etc
etc.............no macro required, unless you specifically want one for
automation purposes.......

hth
Vaya con Dios,
Chuck, CABGx3
 
G

Guest

I am working with some rows that need broken while others do not, they are
intermittantly spread through out the sheet. Also, the highlight several
rows, doesn't work because the text is different lengths i.e. names, with no
delimiters. If you have any ideas on how to make the text to column tool
work more accurately with out the macro, I would love to see it. thanks.
 
G

Guest

Maybe something like this.........

Sub TextToColumns()
ActiveCell.Select
Selection.TextToColumns Destination:=Selection, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5,
1))
End Sub

This macro will do Data > TextToColumns > space delimited.........the keys
to keep it to operate in the selected cell only is the above text
"Activecell.select", and "Destination:=Selection".....the rest can be
modified to your needs...

Incidently, the Data > TextToColumns feature will also work with only one
cell selected, without having to be under macro control.

Vaya con Dios,
Chuck, CABGx3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top