• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Transposing multiple rows into columns (not a rectangular range)

okeane2

New Member
I am trying to transpose 100 years of daily data into a single column.


I have rows and columns of daily data I know you can transpose data row by row. I also saw a previous thread to transpose multiple rows into one column (http://chandoo.org/forums/topic/transposing-multiple-rows-into-one-column) but the solution posted does not work when the data range isn't rectangular eg

1 2 3

4 5 6

7 8 9

covert to

1

2

3

4

5

6

6

etc


But I have


1 2 3 4 5

6 7 8 9

10 11 12 13

14 15 16 17 18

19 20 21 22


and i want it as:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15 etc etc


If I try to use =INDEX(MyData,1+INT((ROW(A1)-1)/COLUMNS(MyData)),MOD(ROW(A1)-1+COLUMNS(MyData),COLUMNS(MyData))+1)

It wont't work. I can't substitute zero in to make the range rectangular as this will skew my results.


I am absolutely useless at excel and have 100 years of daily data to transpose and my time is running out!


Anybody have any suggestions?
 
hi ,


Try this code in the ThisWorkBook section of your VBA Project :

[pre]
Code:
Public Sub Transfer_Range_To_Column()
Dim StartRow As Integer
Dim TransposeColumn As Range
Dim DataRange As Range
Dim Data_Array As Variant

Set DataRange = ThisWorkbook.Worksheets("Sheet1").Range("D5:J8")                    ' Change as required
Set TransposeColumn = ThisWorkbook.Worksheets("Sheet2").Range("M1").EntireColumn    ' Change as required
StartRow = 5                                                                        ' Change as required

DataRange.Parent.Activate
DataRange.Select
Number_of_Rows = Application.WorksheetFunction.CountA(Selection)
Data_Array = Range(TransposeColumn.Cells(StartRow, 1).Resize(Number_of_Rows).Address).Value

i = 1
For Each cell In Selection
If cell <> "" Then
Data_Array(i, 1) = cell
i = i + 1
End If
Next

TransposeColumn.Parent.Activate
Range(TransposeColumn.Cells(StartRow, 1).Resize(Number_of_Rows).Address).Value = Data_Array

Set TransposeColumn = Nothing
Set DataRange = Nothing
End Sub
[/pre]
Narayan
 
Hi, okeane2!


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


As a starting point I'd recommend you to read the three first green sticky topics at this forums main page. There you'll find general guidelines about how this site and community operates (introducing yourself, posting files, netiquette rules, and so on).


Among them you're prompted to perform searches within this site before posting, because maybe your question had been answered yet.


Feel free to play with different keywords so as to be led thru a wide variety of articles and posts, and if you don't find anything that solves your problem or guides you towards a solution, you'll always be welcome back here. Tell us what you've done, consider uploading a sample file as recommended, and somebody surely will read your post and help you.


And about your question...


Give a look at this file:

https://dl.dropbox.com/u/60558749/Transposing%20multiple%20rows%20into%20columns%20%28not%20a%20rectangular%20range%29%20%28for%20okeane2%20at%20chandoo.org%29.xlsx


It's a different approach without macros.


Regards!
 
wigs hair extensions


wigs could be classified into short, half wig cheap hair extensions extension and long. From the style the wigs could possibly be classified into Straight,Curly and Wavy. From the materials the wigs could possibly be classified into individual hair wigs,Synthetic wigs, European wigs and African American wigs.

Lace wigs are specifically designed for all those with moderate to really serious hair loss, but could possibly be used by any personal who desires the good extraordinary lace affords. This lace produces the illusion how the hair really grows from the scalp. It really is made from the fine poly-silk mesh bottom by which fibers are hand tied to this slim breathable fabric. clip in hair extensions It really is positioned at either the hairline or from the top towards the crown, which could possibly be parted in any path for maximum styling versatility. They could possibly be light-weight and softer towards touch than frequent wigs.

The inexpensive ray bans sunglasses for each and every and every occasion.cheap ray bans If you certainly are a certified and pondering upon upgrading your personalitys eloquence within your office or if you can be the frequent party animal Ray bans large selection is the only destination you need to be heading for.ray ban sunglasses british Ray Bans selection also boasts of the broad variety of sunglasses each and every for men, women and kids.

Nike brand identify name is one from one of the most well-known shoes in the globe. clip in individual hair extensions new nike oxygen max british Sneakers are correctly identified for their longevity, comfort and ease and huge array of choices. Nike shoes are well-known for their extraordinary and delivering top functionality.For occasion, which is substantially beautiful, enchanting and fascinating shoes for all the whole world broad sportsmen.cheap nike oxygen max 2012 They not just give you a sheer piece of handle within your existence but human hair extensions also give you an enormous mental relaxation. The shoes are utilized for informal wear and sportswear.
 
Thank you SirJB7!


I had searched for the solution already but could only get it for rectangular ranges. Thanks again, this worked out perfectly and cut my workload immensely!
 
Hi, okeane2!

Glad you solved it. Thanks for your feedback and for your kind words too. Welcome back whenever needed or wanted.

Regards!
 
Back
Top