Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 5
Default Transpose multiple groups of columns to multiple rowsrow

I have on 1 row:

Date, Author, URL, Book1, URL1, Sales1, Book2, URL2, Sales2, Book3, URL3, Sales3.

And repeat.

I would like:

Date, Author, URL, Book1, URL1, Sales1,
Date, Author, URL, Book2, URL2, Sales2,
Date, Author, URL, Book3, URL3, Sales3,

Thank you for your help.
  #2   Report Post  
Junior Member
 
Posts: 5
Default

Quote:
Originally Posted by Billy_McSkintos View Post
I have on 1 row:

Date, Author, URL, Book1, URL1, Sales1, Book2, URL2, Sales2, Book3, URL3, Sales3.

And repeat.

I would like:

Date, Author, URL, Book1, URL1, Sales1,
Date, Author, URL, Book2, URL2, Sales2,
Date, Author, URL, Book3, URL3, Sales3,

Thank you for your help.
Bumping as I really need a solution. I hope someone can help?
  #3   Report Post  
Senior Member
 
Location: Philippines
Posts: 161
Default

Quote:
Originally Posted by Billy_McSkintos View Post
I have on 1 row:

Date, Author, URL, Book1, URL1, Sales1, Book2, URL2, Sales2, Book3, URL3, Sales3.

And repeat.

I would like:

Date, Author, URL, Book1, URL1, Sales1,
Date, Author, URL, Book2, URL2, Sales2,
Date, Author, URL, Book3, URL3, Sales3,

Thank you for your help.
Pivot table?
__________________
Asobi Wa Owari Da
  #4   Report Post  
Junior Member
 
Posts: 5
Default

Quote:
Originally Posted by wickedchew View Post
Pivot table?
Thank you wickedchew. I managed to do it after posting in the Friday "Open" thread on http://lifehacker.com/tag/openthread/. @Enginerd replied with some VBA:
Code:
Sub modify_data() 

'source data is on Sheet1 
'parsed data is on Sheet2 

DestinationRow = 2 'initial destination row 

For i = 1 To 5 'define how many rows you need to segregate 
j = 4 'defines the starting column of the first book title 
Do Until Sheet1.Cells(i, j).Value = "" 'do until there is no book title 
Sheet2.Cells(DestinationRow, 1).Value = Sheet1.Cells(i, 1).Value 'Date 
Sheet2.Cells(DestinationRow, 2).Value = Sheet1.Cells(i, 2).Value 'Author 
Sheet2.Cells(DestinationRow, 3).Value = Sheet1.Cells(i, 3).Value 'URL 
Sheet2.Cells(DestinationRow, 4).Value = Sheet1.Cells(i, j).Value 'Book 
Sheet2.Cells(DestinationRow, 5).Value = Sheet1.Cells(i, j + 1).Value 'URL 
Sheet2.Cells(DestinationRow, 6).Value = Sheet1.Cells(i, j + 2).Value 'Sales 
DestinationRow = DestinationRow + 1 'increment the row for the next entry 
j = j + 3 'change column reference to the column containing the next possible book title in the source row 
Loop 
Next i 

End Sub
With a little tweaking for my specific situation this worked perfectly! I hope this helps someone else but the thanks must go to @Enginerd
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
Transpose multiple Columns to rows Michelle Excel Worksheet Functions 8 March 5th 10 10:55 PM
Transpose multiple columns [email protected] Excel Discussion (Misc queries) 3 April 17th 08 09:00 PM
Transpose multiple columns, functions Nancy Excel Worksheet Functions 6 April 14th 08 11:48 PM
I need a macro to transpose multiple columns A1-Z1, A2-X2 etc Wombat62 Excel Discussion (Misc queries) 7 September 18th 06 05:05 AM
repeated transpose from rows to columns with unequal groups kraymond Excel Discussion (Misc queries) 3 December 20th 04 02:39 PM


All times are GMT +1. The time now is 11:45 AM.

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"