Convert text to column

S

shital

Hi to all
I have copyed data from PDF file.
i have to copy more than 20000 data and convert into two
(2) columns.
i want to use Data--->Text to Column function.
i try recording macro but it convert only range which is
given in range list. How can i wirte macro that it
convert text to column which i have selected range.

sub text()

Range("J5:J13").Select
Selection.TextToColumns Destination:=Range("J5"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(11, 1))
Range("J5").Select
End Sub

any help.
 
N

Norman Jones

Hi Shital

Try:

Sub Tester02()
Selection.TextToColumns Destination:=Selection(1), _
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), _
Array(11, 1))
End Sub
 

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