• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need VBA Code For Text To Column.

premjeet

New Member
I have a data in Column "A". I want a VBA Code for Text to Column.


Column A Data : 1-1-LAM1,04/10/13 00:01:21,67.25


VBA Code Required for below format


1 1 LAM1 4/10/2013 00:01:21 67.25
 
Hi,


Please use the below code.


This is a recorded code so you should have the date in A column and slect all the date and run the macro. This macro blindly work with - and ,


Sub Macro6()

Selection.TextToColumns Destination:=Range("B1"), DataType:=xlDelimited, _

TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _

Semicolon:=False, Comma:=True, Space:=True, Other:=True, OtherChar:= _

"-", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), _

Array(6, 1)), TrailingMinusNumbers:=True

End Sub


Thanks,

SK
 
Thanks SK it working very well.

But for column A1 only.

What i need to modify that above code work for all the data are in column "A".
 
Hi Prem,


Select all the cells which contains the data in Column A and run the macro.


Suppose if you have data from A1 to A6 then select A1 to A6 and run the code


Thanks,

SK
 
Back
Top