How to copy columns to a specific column header and repeat?

Solved/Closed
stylus33 Posts 2 Registration date Friday October 13, 2017 Status Member Last seen November 10, 2017 - Updated on Oct 14, 2017 at 06:56 AM
stylus33 Posts 2 Registration date Friday October 13, 2017 Status Member Last seen November 10, 2017 - Nov 10, 2017 at 12:42 AM
Hello all, am new to using macros in excel. i have data and i want to be able to columns and paste it under some specific columns repeatedly.

Example
column A Column B Column C ColumD
1 2 1 5
2 1 1 2
3 2 1 2


I want to obtain a result where like example column B, Column C and Column D are all pasted under Column A

Result should look like this

Column A
1
2
3
2
1
2
1
1
1
5
2
2

the problem is the columns are soo many i want to automate it. I am new to programming any help.

Thanks

1 response

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 552
Oct 16, 2017 at 11:48 AM
Hi Stylus,

The following code will help you out:
Sub RunMe()
Dim lCol, x As Integer

lCol = Cells(1, Columns.Count).End(xlToLeft).Column

For x = 2 To lCol
    ActiveSheet.UsedRange.Columns(x).Cut _
    Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Next x

End Sub


Best regards,
Trowa
0
stylus33 Posts 2 Registration date Friday October 13, 2017 Status Member Last seen November 10, 2017
Nov 10, 2017 at 12:42 AM
Thanks buddy..it works
0