Report

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

Ask a question stylus33 2Posts Friday October 13, 2017Registration date November 10, 2017 Last seen - Last answered on Nov 10, 2017 at 12:42 AM by stylus33
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
Helpful
+0
plus moins
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
stylus33 2Posts Friday October 13, 2017Registration date November 10, 2017 Last seen - Nov 10, 2017 at 12:42 AM
Thanks buddy..it works
Reply
Leave a comment

Member requests are more likely to be responded to.

Members can monitor the statuses of their requests from their account pages.

A CCM membership gives you access to additional options.

Not a member yet?

Sign up now. It takes less than a minute and is completely free!