+ Reply to Thread
Results 1 to 12 of 12

Combining data from multiple workbooks into one

  1. #1
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    312

    Combining data from multiple workbooks into one

    Hi all,

    I've got ...hundreds.. of csv files which need to be combined into a single workbook. Atm it's a case of copy columns A-D, paste, copy columns A-D, paste & I'm losing the will to live! Surely there's some magic VBA that can speed this up

    I've included 3 raw files below (A, AAL, AAP), as well as a sheet showing how the data needs to be arranged ("Combined").

    Cheers

    Mdn
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Combining data from multiple workbooks into one


    Hi,

    as your Combined attachment can not contain any code so where must be located the VBA procedure ?!
    And you forgot to mention the source text files folder path ! Always the same or can change ?
    According to Combined workbook folder : same as the source text files or what ?
    As coding can't be guessing …

  3. #3
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2503
    Posts
    1,462

    Re: Combining data from multiple workbooks into one

    I would use Power Query to import all of the files into one table. GIYBF for Power Query
    If things don't change they stay the same

  4. #4
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    312

    Re: Combining data from multiple workbooks into one

    Quote Originally Posted by CheeseSandwich View Post
    I would use Power Query to import all of the files into one table. GIYBF for Power Query
    I did try that but it created a huge single table, which isn't quite what I'm after

  5. #5
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    312

    Re: Combining data from multiple workbooks into one

    Quote Originally Posted by Marc L View Post

    as your Combined attachment can not contain any code so where must be located the VBA procedure ?!
    And you forgot to mention the source text files folder path ! Always the same or can change ?
    According to Combined workbook folder : same as the source text files or what ?
    As coding can't be guessing …
    That's because I manually copied the data, i'm a complete novice when it comes to vba hence I didn't save it as an xlsm. The source folder could be anything (i.e. "desktop/new folder")
    Last edited by Median; 04-20-2023 at 06:56 AM.

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Post Re: Combining data from multiple workbooks into one


    ( Removed as I misread )
    Last edited by Marc L; 04-20-2023 at 07:10 AM.

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Combining data from multiple workbooks into one


    According to your hundred of csv files 'Symbol' should be the first column
    in order to use some fast way rather than a beginner classic slower VBA way if the layout must stay as it is
    so what's your choice ?

    Another point : under Windows only ?

  8. #8
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    312

    Re: Combining data from multiple workbooks into one

    No "date" is the 1st column.

    here's what I'm doing manually

    1. Open "A.csv"
    2. Copy columns A-D
    3. Paste columns A-D into workbook "Combined" columns A-D
    4. Open "AAL.csv"
    5. Copy columns A-D
    6. Paste columns A-D into workbook "Combined" columns F-I
    7. Open "AAP.csv"
    8. Copy columns A-D
    9. Paste columns A-D into workbook "Combined" columns K-N

    that help?

    I just assumed because it's such a rigid process vba would be a better solution (albeit my vba knowledge is virtually 0!)
    Last edited by Median; 04-20-2023 at 07:40 AM.

  9. #9
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Combining data from multiple workbooks into one


    ( removed as issue on my side )
    Last edited by Marc L; 04-20-2023 at 08:33 AM.

  10. #10
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    312

    Re: Combining data from multiple workbooks into one

    It's ok Marc tbh I think Cheese's power query solution will work.

    Thanks for your time though, appreciated

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Combining data from multiple workbooks into one

    vba
    Place all the csv files and Combined workbook in the same folder.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    312

    Re: Combining data from multiple workbooks into one

    That's magic Jindon, cheers mate!

+ 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] Combining data from multiple Worksheets located in multiple Workbooks
    By ExcelRookie2016 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-23-2016, 04:55 PM
  2. VBA Combining Data from multiple Workbooks
    By yisfromer in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-18-2014, 02:59 PM
  3. Combining a data range from Multiple Workbooks
    By circe10 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-16-2014, 09:43 PM
  4. combining data from multiple excel workbooks
    By VenomWRX in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-10-2011, 02:15 PM
  5. Combining data from multiple workbooks
    By dhd2005 in forum Excel General
    Replies: 2
    Last Post: 09-21-2010, 02:24 PM
  6. Combining Data from multiple workbooks
    By omniplayer in forum Excel General
    Replies: 5
    Last Post: 01-29-2006, 08:20 AM
  7. [SOLVED] Question about combining data from multiple workbooks into one rep
    By BookOpenandUpright in forum Excel General
    Replies: 2
    Last Post: 02-19-2005, 09:06 AM

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