Hi there,
I would like to write the following loop, could you give me some idea how to write it?
I need the macro to copy columns with the same region in the mater workbook to another workbook.
For example, the macro will copy the column A to C to a new workbook named EAST.
then the macro will come back to the master workbook and copy column A and column D to G to a new workbook named SOUTH... until all the region row =""
[TABLE="class: outer_border, width: 700, align: center"]
<tbody>[TR]
[TD]Column 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]
[/TR]
[TR]
[TD]Name[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Region[/TD]
[TD]EAST[/TD]
[TD]EAST[/TD]
[TD]SOUTH[/TD]
[TD]SOUTH[/TD]
[TD]SOUTH[/TD]
[TD]SOUTH[/TD]
[TD]NORTH[/TD]
[TD]NORTH[/TD]
[TD]WEST[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am thinking about calculating columns and using x and y to loop through it, but not sure how to do it. Could you help me with this?
Thanks a million!!
Christina
I would like to write the following loop, could you give me some idea how to write it?
I need the macro to copy columns with the same region in the mater workbook to another workbook.
For example, the macro will copy the column A to C to a new workbook named EAST.
then the macro will come back to the master workbook and copy column A and column D to G to a new workbook named SOUTH... until all the region row =""
[TABLE="class: outer_border, width: 700, align: center"]
<tbody>[TR]
[TD]Column 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]
[/TR]
[TR]
[TD]Name[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Region[/TD]
[TD]EAST[/TD]
[TD]EAST[/TD]
[TD]SOUTH[/TD]
[TD]SOUTH[/TD]
[TD]SOUTH[/TD]
[TD]SOUTH[/TD]
[TD]NORTH[/TD]
[TD]NORTH[/TD]
[TD]WEST[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am thinking about calculating columns and using x and y to loop through it, but not sure how to do it. Could you help me with this?
Code:
Range(Cells(1, x), Cells(800, y)).Copy
Thanks a million!!
Christina
Last edited: