VBA Copying multiple Columns to 1 column?? [Solved/Closed]

weenie 10 Posts Saturday July 3, 2010Registration date May 5, 2016 Last seen - Jul 9, 2010 at 01:26 PM - Latest reply:  sunilmkhr
- Jul 16, 2010 at 05:32 AM
Hello,
I have data in columns A-F and where the row ends in each column varies. what I would like to do is cut COlumns B & put into column A at the next available empty cell and continue for each column until it hits an empty column. I really don't want to specify Column F as ending because at times my data might go up to column M or Z, etc,. So, is there a way to to to move those columns all into column A at the next available empty cell in Col. A? I appreciate any help, I have looked around and can not find anything.

Example
A B C D E F
1 35 -50 -.545 101 1.025
4 95 -45 -.90 -25 2.5

Into this format
A
1
4
35
95
-50
-45
-.545
-.90
101
-25
1.025
2.5

Thanks


See more 

3 replies

Best answer
6
Thank you
<code><code><code>Hi Try the below one. if you have column headings then change value of n i.e. n=2
</code></code></code>sub sunilmkhr()

sheets("sheet1").cells(1,1).select
Selection.End(xlDown).Select
Activecell.offset(1,0).select
C= Activecell.Address
B=2
n=1
Do until D=""
sheets("sheet1").cells(n,B).select
range(selection, (selection.End(xlDown).select)
selection.copy
range(C).select
Activesheet.paste
Selection.End(xlDown).Select
Activecell.offset(1,0).select
C= Activecell.Address
B=B+1
D=sheets("sheet1").cells(n,B).value
loop
end sub

Thank you, sunilmkhr 6

Something to say? Add comment

CCM has helped 1867 users this month

Thank You, it worked!!!
Always Welcome...