Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 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
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
help on splitting into columns [email protected] Excel Discussion (Misc queries) 5 November 8th 08 07:58 PM
putting 2 long columns into multiple columns in excel page and sor bob_mhc Excel Discussion (Misc queries) 1 April 25th 08 07:51 AM
Combine multiple columns into two long columns, Repeating rows in first column [email protected] Excel Discussion (Misc queries) 2 July 31st 06 09:45 PM
Combine multiple columns into two long columns, Repeating rows in first column [email protected] Excel Discussion (Misc queries) 0 July 31st 06 05:07 PM
Split Long Text Cell into Two Shorter Cells Without Splitting Word Naomi T Excel Discussion (Misc queries) 1 July 7th 05 06:49 AM


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