Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
splitting long columns
I have a spreadhseet that has about 800+ rows (2 columns), which takes
several pages. I am convering this sheet to PDF. Is there a way, within Excel, that I can automaticaly split after a set number of rows, copy the data and paste it to the top of the page in different columns? This way ..intead of 2 column x 800 rows (and 15 pages), I would have 8 columns x 200 rows (and 4 pages). |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
splitting long columns
Assuming your data is in cols A & B, try this small macro:
Sub Columnize() n = Cells(Rows.Count, "A").End(xlUp).Row k = 1 j = 1 For I = 1 To n Set r = Range(Cells(I, 1), Cells(I, 2)) r.Copy Cells(k, j) k = k + 1 If k = 201 Then k = 1 j = j + 2 End If Next Range("A201:B" & n).Clear End Sub -- Gary''s Student - gsnu200851 "richzip" wrote: I have a spreadhseet that has about 800+ rows (2 columns), which takes several pages. I am convering this sheet to PDF. Is there a way, within Excel, that I can automaticaly split after a set number of rows, copy the data and paste it to the top of the page in different columns? This way .intead of 2 column x 800 rows (and 15 pages), I would have 8 columns x 200 rows (and 4 pages). |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
splitting long columns
Thank you ..that works great!
Is there a way I can modify the macro so that it skips one column between each pair that is copied? "Gary''s Student" wrote: Assuming your data is in cols A & B, try this small macro: Sub Columnize() n = Cells(Rows.Count, "A").End(xlUp).Row k = 1 j = 1 For I = 1 To n Set r = Range(Cells(I, 1), Cells(I, 2)) r.Copy Cells(k, j) k = k + 1 If k = 201 Then k = 1 j = j + 2 End If Next Range("A201:B" & n).Clear End Sub -- Gary''s Student - gsnu200851 "richzip" wrote: I have a spreadhseet that has about 800+ rows (2 columns), which takes several pages. I am convering this sheet to PDF. Is there a way, within Excel, that I can automaticaly split after a set number of rows, copy the data and paste it to the top of the page in different columns? This way .intead of 2 column x 800 rows (and 15 pages), I would have 8 columns x 200 rows (and 4 pages). |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
splitting long columns
Just a one line change:
Sub Columnize() n = Cells(Rows.Count, "A").End(xlUp).Row k = 1 j = 1 For I = 1 To n Set r = Range(Cells(I, 1), Cells(I, 2)) r.Copy Cells(k, j) k = k + 1 If k = 201 Then k = 1 j = j + 3 End If Next Range("A201:B" & n).Clear End Sub In this version we bump j by 3 rather than 2. -- Gary''s Student - gsnu200851 "richzip" wrote: Thank you ..that works great! Is there a way I can modify the macro so that it skips one column between each pair that is copied? "Gary''s Student" wrote: Assuming your data is in cols A & B, try this small macro: Sub Columnize() n = Cells(Rows.Count, "A").End(xlUp).Row k = 1 j = 1 For I = 1 To n Set r = Range(Cells(I, 1), Cells(I, 2)) r.Copy Cells(k, j) k = k + 1 If k = 201 Then k = 1 j = j + 2 End If Next Range("A201:B" & n).Clear End Sub -- Gary''s Student - gsnu200851 "richzip" wrote: I have a spreadhseet that has about 800+ rows (2 columns), which takes several pages. I am convering this sheet to PDF. Is there a way, within Excel, that I can automaticaly split after a set number of rows, copy the data and paste it to the top of the page in different columns? This way .intead of 2 column x 800 rows (and 15 pages), I would have 8 columns x 200 rows (and 4 pages). |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
help on splitting into columns | Excel Discussion (Misc queries) | |||
putting 2 long columns into multiple columns in excel page and sor | Excel Discussion (Misc queries) | |||
Combine multiple columns into two long columns, Repeating rows in first column | Excel Discussion (Misc queries) | |||
Combine multiple columns into two long columns, Repeating rows in first column | Excel Discussion (Misc queries) | |||
Split Long Text Cell into Two Shorter Cells Without Splitting Word | Excel Discussion (Misc queries) |