Split a group of 3 very long columns into shorter groups of 3

talla

New Member
Joined
Apr 16, 2019
Messages
4
I have a sheet with 2 columns and 10802 rows. I need to split the group of 2 columns into several groups of 2 columns so the sheet is shorter. Ultimately, I want to save it as a 2 page PDF filled with 2-column sets of data.
Row 1 is column headers (text). All other cells are numbers.
Column A has a series of numbers from 100 to 10900 in order. Column B is a number.
The columns need to be divided every 55 rows (header row + 54 rows of data).
Headers must be repeated for each group.

AB
1H1H2
21005.5
31014.3
41025.2
51033.3

<tbody>
</tbody>











I will greatly appreciate any suggestion as to how I can accomplish this. A macro would be awesome.
Thanks
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Re: Split a group of 2 very long columns into shorter groups of 2

Sorry - title should be "Split a group of 2 very long columns into shorter groups of 2"
 
Upvote 0
Re: Split a group of 2 very long columns into shorter groups of 2

Give this macro a try...
Code:
Sub SplitTwoLongColumnsToSeriesOfShorterColumns()
  Dim R As Long, C As Long, LastRow As Long
  LastRow = Cells(Rows.Count, "A").End(xlUp).Row
  C = 1
  For R = 56 To LastRow Step 54
    C = C + 2
    Cells(1, C).Resize(, 2).Value = Range("A1:B1").Value
    Cells(R, "A").Resize(54, 2).Copy Cells(2, C)
  Next
  Range("A56:B" & LastRow).Clear
End Sub
 
Upvote 0
Re: Split a group of 2 very long columns into shorter groups of 2

Awesome! Thank you so much!


Give this macro a try...
Code:
Sub SplitTwoLongColumnsToSeriesOfShorterColumns()
  Dim R As Long, C As Long, LastRow As Long
  LastRow = Cells(Rows.Count, "A").End(xlUp).Row
  C = 1
  For R = 56 To LastRow Step 54
    C = C + 2
    Cells(1, C).Resize(, 2).Value = Range("A1:B1").Value
    Cells(R, "A").Resize(54, 2).Copy Cells(2, C)
  Next
  Range("A56:B" & LastRow).Clear
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,939
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top