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

Report
Posts
10
Registration date
Saturday July 3, 2010
Status
Member
Last seen
May 5, 2016
-
 sunilmkhr -
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


1 reply

<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
6
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

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

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!