View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default MERGING COLUMNS TO ONE

Option Explicit
Sub makeallcolumnsone()
Dim i, slr, dlr As Long
For i = 2 To _
Cells(1, Columns.Count).End(xlToLeft).Column
slr = Cells(Rows.Count, i).End(xlUp).Row
dlr = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(1, i).Resize(slr).Copy Cells(dlr, 1)
Next i
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Faraz A. Qureshi" wrote in
message ...
Would one of you experts kindly devise me a code so as to merge the
different
sizes of blocks of a table in a single column.

For example the source data is

A01 BX1 C2 D1
A02 BX2 D2
A03 BX3
A04 D3

What code could copy the columns onto some other location/sheet as
follows:

A01
A02
A03
A04
BX1
BX2
BX3
C2
D1
D2
<<Blank Cell
D3

cpearson's outstanding the reversal, i.e. Column to Table at
http://www.cpearson.com/Excel/Variab...mnToTable.aspx
but I sure am making mistakes in having the said code modified to carry
out
such exercise the other way around.

Thanx in advance.

--
Best Regards,

Faraz