Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Text To Columns Looping Macro

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping through columns Mick[_2_] Excel Programming 1 February 7th 08 07:27 PM
Looping macro needed to find intersections of rows and columns Clifford Middleton Excel Programming 1 January 5th 06 01:04 PM
Looping thru columns Robert Excel Programming 5 June 15th 05 09:48 AM
Macro for Text to Columns - convert to text or general goofy11 Excel Programming 1 May 16th 05 03:51 AM
Looping through columns teresa Excel Programming 2 December 31st 04 07:25 PM


All times are GMT +1. The time now is 10:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"