+ Reply to Thread
Results 1 to 5 of 5

How Do I Combine Multiple One-Column XLSX Files Into One File With Multiple Columns?

  1. #1
    Registered User
    Join Date
    10-22-2014
    Location
    Earth
    MS-Off Ver
    Office 2010
    Posts
    6

    Question How Do I Combine Multiple One-Column XLSX Files Into One File With Multiple Columns?

    I have 200 .XLSX files that are numbered 1 - 200, each of them containing one column of data (with an equal number of rows).

    I want to combine all of these files into one file that has 200 columns of data, and I need the columns to be imported into the single file in the same order as the order of the .XLSX files.

    Is there any way to accomplish this?

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: How Do I Combine Multiple One-Column XLSX Files Into One File With Multiple Columns?

    This addin should do the trick http://www.rondebruin.nl/win/addins/rdbmerge.htm

    Read the notes carefully. They explain how to put columns next to each other

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: How Do I Combine Multiple One-Column XLSX Files Into One File With Multiple Columns?

    Because I was bored I wrote a macro that

    A) assumes the file names goes from 1.xlsx, 2.xlsx, ............. 200.xlsx

    B) there is only one sheet in all these 200 files

    You need to specify the folder where the files are found i.e. you must change the sPath "=C:\Temp\" to this folder, don't forget the last "\" if missing from sPath macro will not run.

    Result will be written to firs empty column in target file (the file that contains this macro) In the first row you will get the file name i.e. "1.xlsx" in cell A1 and all the data from this file in A2 and downwards. "2.xlsx" in B1 and so fort. If a file is missing i.e. "125.xlsx" but not "126.xlsx" macro will ignore missing file and move on to next file.

    At the moment loop is set for 200 files. If there are other files in this folder these will be ignored only files with names from "1.xlsx" to "200.xlsx" will be processed.

    Please Login or Register  to view this content.
    Alf

  4. #4
    Registered User
    Join Date
    10-22-2014
    Location
    Earth
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: How Do I Combine Multiple One-Column XLSX Files Into One File With Multiple Columns?

    Quote Originally Posted by Pepe Le Mokko View Post
    This addin should do the trick http://www.rondebruin.nl/win/addins/rdbmerge.htm

    Read the notes carefully. They explain how to put columns next to each other
    This worked like a charm, but I had to start the numbering at 100 to get it to read the files in the correct order. Thanks!

    Also, thank you to Alf for the code, I hope someone out there will be able to put it to use.

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: How Do I Combine Multiple One-Column XLSX Files Into One File With Multiple Columns?

    I hope someone out there will be able to put it to use
    No problem, I enjoyed myself figuring out this code.

    Alf

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Split Large Excel XLSX File Into Multiple XLS Files
    By EnormousRA in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-23-2016, 08:56 PM
  2. Combining Data from Multiple .xlsx Files with Multiple Sheets
    By jeannelee94 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2015, 10:03 AM
  3. copy specific cells from multiple .xlsx files into a table in destination file
    By khhleung in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-09-2014, 07:18 PM
  4. Split Large Excel XLSX File Into Multiple XLS Files
    By EnormousRA in forum Excel General
    Replies: 1
    Last Post: 10-05-2013, 09:18 AM
  5. Combine multiple Ecxel files in one master file with VB
    By jelena1290 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-10-2012, 12:36 AM
  6. How to add the columns data of several xlsx files of a folder in another xlsx file
    By ravikumar00008 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-25-2012, 04:29 AM
  7. Replies: 4
    Last Post: 09-22-2010, 01:22 PM

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