+ Reply to Thread
Results 1 to 11 of 11

Import multiple semicolon separated csv files

  1. #1
    Registered User
    Join Date
    06-14-2010
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    3

    Import multiple semicolon separated csv files

    Guys,

    After several hours of ‘googling’, my hopes are on you for solving my VBA csv-import problem. The problem is the following:

    I’m trying to import several semicolon separated .csv files in one Excel worksheet (multiple tabs). The import works fine, but the separation in different columns doesn’t go well. The most solutions I found work fine for one csv file, but don’t work in my code:


    Please Login or Register  to view this content.


    Who can help me out? Your advice is truly appreciated!
    Ivo
    Last edited by pike; 06-14-2010 at 05:48 AM. Reason: Add tags for newbie

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Import multiple semicolon separated csv files

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Import multiple semicolon separated csv files

    Hi Ivo,

    Do you want each csv file to be imported into a new tab or all in the same tab?

    abousetta

  4. #4
    Registered User
    Join Date
    06-14-2010
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Import multiple semicolon separated csv files

    I all want them to be imported in a new tab.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Import multiple semicolon separated csv files

    Please Login or Register  to view this content.
    or even simpler
    Please Login or Register  to view this content.
    Last edited by snb; 06-14-2010 at 07:13 AM.

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Import multiple semicolon separated csv files

    Opens a dialog box asking for the folder and then imports all the csv files from that folder.

    Please Login or Register  to view this content.
    abousetta

  7. #7
    Registered User
    Join Date
    06-14-2010
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Import multiple semicolon separated csv files

    Thanks Abousetta,

    this works nice. I think my answer to your first question was a little vague. But I actually want each csv file to be imported to it's own tab. Preferably I want the tabs to get the name of the corresponding csv-file. Do you have a solution for that?
    Ivo

  8. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Import multiple semicolon separated csv files

    Please Login or Register  to view this content.
    PS. Dit lijkt me een stuk eenvoudiger
    Much simpler I'd say

  9. #9
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Import multiple semicolon separated csv files

    I agree that snb's approach is simpler. Snb would you care to elaborate on the approach so we can learn from it and be able to modify/ reproduce it in the future.

    abousetta

  10. #10
    Registered User
    Join Date
    12-07-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Import multiple semicolon separated csv files

    Can you please suggest me how to add the csv file name in the first column in the above code from abousetta

  11. #11
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Import multiple semicolon separated csv files

    Hello @timepass_2,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.

    Now that we got the formalities out of the way, another poster had a similar question to yours. Here you will find a newer version of the code above and here you will find another version of the code using the Dir method and incorporating the file name. If you still problems modifying either code to your needs then please start a new thread and PM me the URL.

    Good luck.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

+ 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