I have a very large speadsheet, that is only about 15 rows down, but extremely wide (i think 12,000 across!)
I would like to copy every 5 columns and paste down as per the attachment.
Any vba advise would be hugely appreciated!
Thank you.
I have a very large speadsheet, that is only about 15 rows down, but extremely wide (i think 12,000 across!)
I would like to copy every 5 columns and paste down as per the attachment.
Any vba advise would be hugely appreciated!
Thank you.
Something like:
![]()
Sub foo() Dim lCol As Long, lRows As Long Application.ScreenUpdating = False With ActiveSheet lRows = .Cells(Rows.Count, 1).End(xlUp).Row For lCol = 6 To .Cells(1, Columns.Count).End(xlToLeft).Column Step 5 .Cells(1, lCol).Resize(lRows, 5).Copy .Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) .Cells(1, lCol).Resize(lRows, 5).Clear Next lCol End With End Sub
let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source
If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE
Walking the tightrope between genius and eejit...
This should do it, same idea:
![]()
Option Explicit Sub TransposeDataGroups() Dim LC As Long, Col As Long, NewSH As Worksheet With ActiveSheet LC = Cells(1, .Columns.Count).End(xlToLeft).Column Set NewSH = Sheets.Add(after:=Sheets(.Index)) For Col = 1 To LC Step 5 .Columns(Col).SpecialCells(xlConstants).Resize(, 5).Copy NewSH.Range("A" & Rows.Count).End(xlUp).Offset(1) Next Col End With End Sub
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
You guys are brilliant! Many thanks, both equally impressive, but more importantly, equally efficient!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks