Text To Columns Looping Macro

D

Danny

I am using Excel 2003

I have the following code that loops through data in Cell A1

Selection.TextToColumns Destination:=Range("A1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(9, 1), Array(12, 1),
Array(22, 1), Array(25, 1)), _
TrailingMinusNumbers:=True
Selection.Cut
Range("A4").Select
ActiveSheet.Paste
Range("C1").Select
Selection.Cut
Range("A5").Select
ActiveSheet.Paste
Range("E1").Select
Selection.Cut
Range("A6").Select

From above the code goes through each array and parses it out in this
case to Cell E1. I would like to know how I can use a loop to do the
above sequence. 9 values then 3 then 9 values then 3 etc....

The second part is copying and pasting every other cell from the above
loop Which is copy Cell A1 paste to A4 then copy C1 and paste to A5
etc... until the data ends.

So is I would guess it would be a loop within a loop but am unsure how
to code this.

Thanks
D
 

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