Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default MERGING COLUMNS TO ONE

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Merging Columns Titanium Excel Worksheet Functions 13 May 31st 10 09:36 PM
Merging 2 columns Mazzie Excel Discussion (Misc queries) 1 March 29th 09 05:11 PM
merging columns Todd Hudson New Users to Excel 2 June 4th 06 05:49 PM
Merging columns daarun New Users to Excel 1 November 21st 05 07:31 PM
Merging Columns Amazincomes Excel Worksheet Functions 1 January 6th 05 09:02 PM


All times are GMT +1. The time now is 02:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"