Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Continuous conversion of data from rows to columns

I have roows of data looks that look like this:
Text1 Text1 Text1 Text1 1 2 3 4 5 6 7 8 9 10 11
Text2 Text2 Text2 Text2 1 2 3 4 5 6 7 8 9 10 11
Text3 ......

I'm trying to convert the above to look like this:
Text1 Text1 Text1 Text1 1 2 3 4
5 6 7 8
9 10 11
Text2 Text2 Text2 Text2 1 2 3 4
5 6 7 8
9 10 11
Text3.....

I created a macro within Excel to arrange the Text1 data, but how can I
continue reading and arranging the next rows within the macro to repeat what
was done to the first one? I assume it's a Do Loop, but just need the code
to force it to read
Row2 and repeat the same process for an "n" number of rows. Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Continuous conversion of data from rows to columns

Now I see your problem from yesterday... Here is some code that I think will
work for you...

Public Sub ConsolidateRows()
Dim wksCopyFrom As Worksheet
Dim rngCopyFrom As Range
Dim wksCopyTo As Worksheet
Dim rngCopyTo As Range

Set wksCopyFrom = ActiveSheet
Set rngCopyFrom = wksCopyFrom.Range("A2")
Set wksCopyTo = Worksheets.Add
Set rngCopyTo = wksCopyTo.Range("A2")

Do While rngCopyFrom.Value < ""
Range(rngCopyFrom, rngCopyFrom.Offset(0, 7)).Copy rngCopyTo
Set rngCopyTo = rngCopyTo.Offset(1, 0)
Range(rngCopyFrom.Offset(0, 8), rngCopyFrom.Offset(0, 11)).Copy
rngCopyTo.Offset(0, 4)
Set rngCopyTo = rngCopyTo.Offset(1, 0)
Range(rngCopyFrom.Offset(0, 12), rngCopyFrom.Offset(0, 15)).Copy
rngCopyTo.Offset(0, 4)
Set rngCopyTo = rngCopyTo.Offset(1, 0)
Set rngCopyFrom = rngCopyFrom.Offset(1, 0)
Loop

End Sub

It Creates a sheet and copies the data over as you have indicated in your
question. It does however assume that your data will be exactly as you
indicated in your question with 4 text and 11 numbers. I hope that will be
OK. I trust that this is a little better than my ramblings of yesterday.

HTH

"Karaman" wrote:

I have roows of data looks that look like this:
Text1 Text1 Text1 Text1 1 2 3 4 5 6 7 8 9 10 11
Text2 Text2 Text2 Text2 1 2 3 4 5 6 7 8 9 10 11
Text3 ......

I'm trying to convert the above to look like this:
Text1 Text1 Text1 Text1 1 2 3 4
5 6 7 8
9 10 11
Text2 Text2 Text2 Text2 1 2 3 4
5 6 7 8
9 10 11
Text3.....

I created a macro within Excel to arrange the Text1 data, but how can I
continue reading and arranging the next rows within the macro to repeat what
was done to the first one? I assume it's a Do Loop, but just need the code
to force it to read
Row2 and repeat the same process for an "n" number of rows. Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Continuous conversion of data from rows to columns

Jim,

Thank you very help for your help. I really appreciate the effort. Now I
can process a lot of data easily.

Best regards,
Karaman

"Jim Thomlinson" wrote:

Now I see your problem from yesterday... Here is some code that I think will
work for you...

Public Sub ConsolidateRows()
Dim wksCopyFrom As Worksheet
Dim rngCopyFrom As Range
Dim wksCopyTo As Worksheet
Dim rngCopyTo As Range

Set wksCopyFrom = ActiveSheet
Set rngCopyFrom = wksCopyFrom.Range("A2")
Set wksCopyTo = Worksheets.Add
Set rngCopyTo = wksCopyTo.Range("A2")

Do While rngCopyFrom.Value < ""
Range(rngCopyFrom, rngCopyFrom.Offset(0, 7)).Copy rngCopyTo
Set rngCopyTo = rngCopyTo.Offset(1, 0)
Range(rngCopyFrom.Offset(0, 8), rngCopyFrom.Offset(0, 11)).Copy
rngCopyTo.Offset(0, 4)
Set rngCopyTo = rngCopyTo.Offset(1, 0)
Range(rngCopyFrom.Offset(0, 12), rngCopyFrom.Offset(0, 15)).Copy
rngCopyTo.Offset(0, 4)
Set rngCopyTo = rngCopyTo.Offset(1, 0)
Set rngCopyFrom = rngCopyFrom.Offset(1, 0)
Loop

End Sub

It Creates a sheet and copies the data over as you have indicated in your
question. It does however assume that your data will be exactly as you
indicated in your question with 4 text and 11 numbers. I hope that will be
OK. I trust that this is a little better than my ramblings of yesterday.

HTH

"Karaman" wrote:

I have roows of data looks that look like this:
Text1 Text1 Text1 Text1 1 2 3 4 5 6 7 8 9 10 11
Text2 Text2 Text2 Text2 1 2 3 4 5 6 7 8 9 10 11
Text3 ......

I'm trying to convert the above to look like this:
Text1 Text1 Text1 Text1 1 2 3 4
5 6 7 8
9 10 11
Text2 Text2 Text2 Text2 1 2 3 4
5 6 7 8
9 10 11
Text3.....

I created a macro within Excel to arrange the Text1 data, but how can I
continue reading and arranging the next rows within the macro to repeat what
was done to the first one? I assume it's a Do Loop, but just need the code
to force it to read
Row2 and repeat the same process for an "n" number of rows. Thanks.


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
repeated conversion of data summarized into rows and columns Ian Excel Discussion (Misc queries) 2 December 28th 09 02:01 AM
Transpose columns into continuous rows PattiP Excel Worksheet Functions 1 April 23rd 09 09:29 PM
Data Conversion - times, dates & rows Sara Excel Worksheet Functions 5 April 15th 09 03:44 AM
Turning rows of equal number of columns into 1 continuous row chimerical Excel Worksheet Functions 1 December 7th 06 09:45 PM
Continued Conversion of data from rows to columns in a macro. Karaman Excel Programming 5 March 3rd 05 03:29 PM


All times are GMT +1. The time now is 11:26 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"