Hi All,
I've searched the forums for this but cant seem to find a solution.
I have multiple worksheets in a workbook, each worksheet has around 7 or 8 columns and the number of rows vary in each workbook. i'm looking for some vba code that will merge the columns next to each other rather than below each other (ive found many codes online that paste below and not side by side).
Column A can remain the same as its has the same data in all sheets but the remaining columns need merging next to each other with a blank column separating them.
Also there are usually around 8 worksheets that need merging.
here's an example:
1st Worksheet
[TABLE="class: grid, width: 300"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[/TR]
</tbody>[/TABLE]
2nd Worksheet
[TABLE="class: grid, width: 300"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 600"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD][/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD][/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD][/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD][/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
</tbody>[/TABLE]
Hope this makes sense and someone can help.
Thank you.
I've searched the forums for this but cant seem to find a solution.
I have multiple worksheets in a workbook, each worksheet has around 7 or 8 columns and the number of rows vary in each workbook. i'm looking for some vba code that will merge the columns next to each other rather than below each other (ive found many codes online that paste below and not side by side).
Column A can remain the same as its has the same data in all sheets but the remaining columns need merging next to each other with a blank column separating them.
Also there are usually around 8 worksheets that need merging.
here's an example:
1st Worksheet
[TABLE="class: grid, width: 300"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[/TR]
</tbody>[/TABLE]
2nd Worksheet
[TABLE="class: grid, width: 300"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 600"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD][/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD][/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD][/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
[TR]
[TD]Worksheet a[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD]Data 1[/TD]
[TD][/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[TD]Data 2[/TD]
[/TR]
</tbody>[/TABLE]
Hope this makes sense and someone can help.
Thank you.