+ Reply to Thread
Results 1 to 4 of 4

Merge many columns into one and many files into one

  1. #1
    Registered User
    Join Date
    08-10-2011
    Location
    Melbourne
    MS-Off Ver
    Excel 2002
    Posts
    9

    Question Merge many columns into one and many files into one

    Hi Patel45,

    Thank you very much for your macro. It works well and I have modified it a bit to get rid of
    blank rows between days.

    Cheers,

    Jayana


    Sub a()
    nrows = 288
    ncols = 366
    drow = nrows + 1
    For c = 2 To ncols
    Range(Cells(1, c), Cells(nrows + 1, c)).Copy Cells(drow, 1)
    drow = drow + nrows + 0
    Next
    For c = 2 To ncols
    Columns(2).Delete
    Next
    End Sub








    Hi Everyone,

    I have 36 excel files with 366 columns and 288 rows each and I want to merge
    all columns into one and all files into one. The task can be devided into two steps:

    Step 1. combine all columns into one. Ref. attached table, I need to get all the data
    into column J which will have 105,408 rows (288 x 366). I can sit down and create
    formulas to do it but thought that there must be better ways of doing it.

    Step 2. merge all 36 files with the same number of rows and columns together. Again
    this can be done by copy and paste 36 times but thought a macro or somehting should
    be able to do it quickly and I want to learn a bit.

    Any help will be appreciated. Thank in advance.

    Jayana
    Attached Files Attached Files
    Last edited by Jayana; 05-06-2013 at 11:24 PM. Reason: SOLVED

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Merge many columns into one and many files into one

    to merge columns try this code
    Please Login or Register  to view this content.
    Last edited by patel45; 05-03-2013 at 01:41 AM.
    If solved remember to mark Thread as solved

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Merge many columns into one and many files into one

    Jayana
    I am not familiar with Excel 2002. Is that a Mac version?
    Excel 2003 has 65,536 Rows so 105,408 surpasses that. It also has only 256 Columns.
    You say that each Workbook has 366 Columns and 288 Rows, right?
    Copying all Columns under one another should be no problem. The easiest is if all Files are in one Folder.
    Is it your intention to get all the Columns of one workbook merged and then all the Columns into one
    Workbook, starting at one particulat Column (Column J) and the next Workbook Column to the Column beside it etc etc?

  4. #4
    Registered User
    Join Date
    08-10-2011
    Location
    Melbourne
    MS-Off Ver
    Excel 2002
    Posts
    9

    Re: Merge many columns into one and many files into one

    Jolivanes,

    I'm using Excel 2010 for window. Yes, all files are in one folder and I'm trying to merge all the columns in each workbook and then put them together into one workbook. I'll try Patel45's code and see.

    Jayana

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1