LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default merge columns

Hello,

This might do what you're after - but make sure the data starts in cell A1.

Dan.

Option Explicit

Sub ToOneColumn()

Dim cntI As Integer
Dim cntJ As Integer
Dim TotalRows As Integer
Dim TotalCols As Integer

TotalRows = ActiveSheet.UsedRange.Rows.Count
TotalCols = ActiveSheet.UsedRange.Columns.Count

For cntJ = 2 To TotalCols

Cells(1, cntJ).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Cut
Cells((cntJ - 1) * TotalRows + 1, 1).Select
ActiveSheet.Paste

Next cntJ

Cells(1, 1).Select

End Sub



"vlad" wrote:

I have 10+ columns of data. I need to have all columns merged one under
another into one column.For example column A. I can do it manually by cutting
the data in each column and pasting it below the last record in column A. But
there should be a way to automate that.Any help with the code will be
apprciated

 
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
Merge Columns The Cable Guy Excel Discussion (Misc queries) 3 February 27th 09 06:51 PM
Merge Columns Templar Excel Discussion (Misc queries) 2 December 9th 08 05:27 PM
merge text from 2 columns into 1 then delete the old 2 columns sleepindogg Excel Worksheet Functions 4 March 30th 06 07:25 PM
How to merge columns from excel and how to set customize each columns lancelot Excel Programming 0 March 25th 06 03:44 AM
I want to merge two columns Andrew New Users to Excel 3 October 26th 05 03:45 AM


All times are GMT +1. The time now is 01:42 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"