I have columns A:ALC
filled 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:ALC
.
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
There is equal amount of data for each pair of columns (e.g. column A
and B
have 8 rows, column C
and D
have 5 rows, and so on), but the number of rows, obviously, differ between the many pairs of columns. There are no blanks trapped inside the data.
When I ran the macro you gave Excel displayed this:
Run-Time Error '13': Type Mismatch
What could be the issue?
NOTE: There are some columns with only a pair of data, that is data only in the first row.
This is what I need the output to look like:
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
See Question&Answers more detail:os