navelgazer
New Member
- Joined
- Mar 9, 2012
- Messages
- 14
<table><tbody><tr><td class="votecell">
</td> <td class="postcell"> I'm new to excel and VBA and I'm stuck at this problem. I have columns A through AKP (A:AKP) with data, and there is a varied number of rows for each column. If possible, I need a macro that will "stack" columns in pairs of two. For example, column "C" directly under column "A" and column "D" directly under column "B" and so on for all columns A:AKP.
This is an example of what my data looks like:
<code> COLUMN A COLUMN B COLUMN C COLUMN D
ROW 1 2598 F800 2599 F800
ROW 2 2598 K1300 2599 K1300
ROW 3 2598 S1000RR 2599 R900
ROW 4 2598 G650 2599 G650
ROW 5 2598 R1200 2599 K1600
ROW 6 2599 S1000
ROW 7 2599 HP2
ROW 8 2599 R1200
.
.
.
</code>
This is an example of what I need the output to look like:
<code> COLUMN A COLUMN B
ROW 1 2598 F800
ROW 2 2598 K1300
ROW 3 2598 S1000RR
ROW 4 2598 G650
ROW 5 2598 R1200
ROW 6 2599 S1000
ROW 7 2599 HP2
ROW 8 2599 R1200
ROW 9 2599 F800
ROW 10 2599 K1300
ROW 11 2599 R900
ROW 12 2599 G650
ROW 13 2599 K1600
.
.
.
Thank you in advance!
</code>
</td></tr></tbody></table>
</td> <td class="postcell"> I'm new to excel and VBA and I'm stuck at this problem. I have columns A through AKP (A:AKP) with data, and there is a varied number of rows for each column. If possible, I need a macro that will "stack" columns in pairs of two. For example, column "C" directly under column "A" and column "D" directly under column "B" and so on for all columns A:AKP.
This is an example of what my data looks like:
<code> COLUMN A COLUMN B COLUMN C COLUMN D
ROW 1 2598 F800 2599 F800
ROW 2 2598 K1300 2599 K1300
ROW 3 2598 S1000RR 2599 R900
ROW 4 2598 G650 2599 G650
ROW 5 2598 R1200 2599 K1600
ROW 6 2599 S1000
ROW 7 2599 HP2
ROW 8 2599 R1200
.
.
.
</code>
This is an example of what I need the output to look like:
<code> COLUMN A COLUMN B
ROW 1 2598 F800
ROW 2 2598 K1300
ROW 3 2598 S1000RR
ROW 4 2598 G650
ROW 5 2598 R1200
ROW 6 2599 S1000
ROW 7 2599 HP2
ROW 8 2599 R1200
ROW 9 2599 F800
ROW 10 2599 K1300
ROW 11 2599 R900
ROW 12 2599 G650
ROW 13 2599 K1600
.
.
.
Thank you in advance!
</code>
</td></tr></tbody></table>
Last edited: