+ Reply to Thread
Results 1 to 3 of 3

Joining multiple CSV files together with 1 header

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    822

    Joining multiple CSV files together with 1 header

    Dear experts,
    I found ways to join csv files on the internet but somehow I do not get them working for me.
    I was thinking it was not that hard, I have a folder on my hardrive which consist of several files.
    Now I want the macro to join all the CSV files.
    The only hard part was the fact that there were 2 types of csv files. Files that start with AMS it needed to join.
    BUT there are also AMSI files which should not be joined with AMS files but with other AMSI files.

    I will attach 3 files. Can someone provide me a meaningfull macro which joins the 2 files that start with AMS and then also put only 1 header?
    Because the files have the same header.
    Other methodes did join the CSV files but also everytime copied the header.
    Thanks.

    ps: note that I have now 2 files but this could well be 5 or 6 depending how many csv files are in the folder.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    822

    Re: Joining multiple CSV files together with 1 header

    Maybe good to mention is that I would like the data of the different CSV files in 1 worksheet.
    I found this could which works fine, only it add the csv files after my existing tabs as extra tabs and that is not what it should do.
    So maybe someone knows how to alter this code so it will paste the data in 1 sheet below eachother? Thanks!.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    822

    Re: Joining multiple CSV files together with 1 header

    Ok I also have found another one which does put everyting below eachother....but....here you have to point out the folder were the files are each time.
    I want to be able to put in the path were the csv files are in the vba code!
    So if someone know how to alter this one so I don;t have to select the folder myself eachtime the macro runs.

    Please Login or Register  to view this content.

+ 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] Importing multiple csv files, adding filename to each row and removing the header
    By Telving in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2012, 12:59 PM
  2. [SOLVED] Import multiple .TXT/.TAB files only using one header row
    By Delta in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-04-2012, 01:58 PM
  3. Joining Data between two excel files
    By Dalia in forum Excel General
    Replies: 2
    Last Post: 11-28-2006, 02:26 PM
  4. Any utility for joining two or more Excel or CVS files
    By headley sappleton in forum Excel General
    Replies: 1
    Last Post: 02-08-2006, 01:20 AM
  5. Any utility for joining two or more Excel or CVS files
    By headley sappleton in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2006, 01:20 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