Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
noelcantona
 
Posts: n/a
Default Combining mutiple columns into one column


Greetings to all,

I have this problem combining mutiple columns to one column only.

For e.g.

Column A= 10 rows
Column B= 10 rows
Column C= 13 rows

I would like to have only 1 column with data of Column A, B and C
(total of 33 rows in this case).

I have a daily of 300 columns coming in, so I need a good long term
solution.

Thank you.

cheers,
-NoeL-


--
noelcantona
------------------------------------------------------------------------
noelcantona's Profile: http://www.excelforum.com/member.php...o&userid=28147
View this thread: http://www.excelforum.com/showthread...hreadid=476609

  #2   Report Post  
Gord Dibben
 
Posts: n/a
Default Combining mutiple columns into one column

NoeL

I believe this macro was posted by Dave Peterson or Bob Phillips.

Whomever was originator, it works.

Sub OneColumn()

''''''''''''''''''''''''''''''''''''''''''
'Macro to copy columns of variable length'
'into 1 continous column in a new sheet '
''''''''''''''''''''''''''''''''''''''''''

Dim ilastcol As Long
Dim ilastrow As Long
Dim jlastrow As Long
Dim colndx As Long
Dim ws As Worksheet
Dim myRng As Range
Dim idx As Integer

Set ws = ActiveWorkbook.ActiveSheet
ilastcol = Cells(1, Columns.Count).End(xlToLeft).Column

With Sheets.Add
.Name = "Alldata"
End With

idx = Sheets("Alldata").Index
Sheets(idx + 1).Activate

For colndx = 1 To ilastcol

ilastrow = ws.Cells(Rows.Count, colndx).End(xlUp).Row
jlastrow = Sheets("Alldata").Cells(Rows.Count, 1) _
.End(xlUp).Row

Set myRng = Range(Cells(1, colndx), _
Cells(ilastrow, colndx))
With myRng
.Copy Sheets("Alldata").Cells(jlastrow + 1, 1)
End With
Next

Sheets("Alldata").Rows("1:1").EntireRow.Delete

End Sub


Gord Dibben Excel MVP


On Sun, 16 Oct 2005 10:38:20 -0500, noelcantona
wrote:


Greetings to all,

I have this problem combining mutiple columns to one column only.

For e.g.

Column A= 10 rows
Column B= 10 rows
Column C= 13 rows

I would like to have only 1 column with data of Column A, B and C
(total of 33 rows in this case).

I have a daily of 300 columns coming in, so I need a good long term
solution.

Thank you.

cheers,
-NoeL-


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
Move column to in-between existing columns Melissa Excel Discussion (Misc queries) 3 August 31st 05 01:43 PM
how to combine several columns into a single column jims Excel Discussion (Misc queries) 9 August 15th 05 12:00 PM
Arithmetical Mode of Criteria in Multiple Non-Adjacent columns Sam via OfficeKB.com Excel Worksheet Functions 4 July 14th 05 09:15 PM
Lookup Table Dilemma Karen Excel Worksheet Functions 2 June 10th 05 08:22 PM
Combining workbooks with some variable field names Bob Dobalina Excel Discussion (Misc queries) 8 May 17th 05 09:48 PM


All times are GMT +1. The time now is 01:14 PM.

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

About Us

"It's about Microsoft Excel"