CMSREPORTS
New Member
- Joined
- Nov 29, 2018
- Messages
- 10
- Office Version
- 2013
- Platform
- Windows
I have a set of horizontal data that needs to be realigned into a veridical list. Each group of 6 columns needs to be cut and appended to the bottom of the first 6 columns.
The process is then repeated for the next 6 columns and appended to the new last row.
I can do this manually, but it is terribly tedious and I am wondering if there is a better way to do it with a loop.
Etc...
The remaining groups of 6 are ...
Y - AD
AE-AJ,
AQ-AV
AW-BB
BC-BH
BI-BN
BO-BT
BU-BZ
CA-CF
CG-CL
CM-CR
CS-CX
CY-DD
DE-DJ
DK-DP
DQ-DV
DW-EB
The process is then repeated for the next 6 columns and appended to the new last row.
I can do this manually, but it is terribly tedious and I am wondering if there is a better way to do it with a loop.
VBA Code:
Sub Realign()
Set ws1 = ThisWorkbook.Sheets("priceListComparison")
ws1.Select
Last_Original = ws1.Cells(1048576, 2).End(xlUp).Row
'Move end date data (G-L)
Last_r1 = ws1.Cells(1048576, 2).End(xlUp).Row
Range("G2:L" & Last_Original).Cut
Range("A" & Last_r1 + 1).Select
ActiveSheet.Paste
'Move Nbr_Amt data (M-R)
Last_r2 = ws1.Cells(1048576, 2).End(xlUp).Row
Range("M2:R" & Last_Original).Cut
Range("A" & Last_r2 + 1).Select
ActiveSheet.Paste
'Move print_indicator data (S-X)
Last_r3 = ws1.Cells(1048576, 2).End(xlUp).Row
Range("S2:X" & Last_Original).Cut
Range("A" & Last_r3 + 1).Select
ActiveSheet.Paste
Etc...
The remaining groups of 6 are ...
Y - AD
AE-AJ,
AQ-AV
AW-BB
BC-BH
BI-BN
BO-BT
BU-BZ
CA-CF
CG-CL
CM-CR
CS-CX
CY-DD
DE-DJ
DK-DP
DQ-DV
DW-EB