+ Reply to Thread
Results 1 to 7 of 7

Import mutiple cvs-files into one sheet.

  1. #1
    Registered User
    Join Date
    06-22-2016
    Location
    Malmo, Sweden
    MS-Off Ver
    2010
    Posts
    5

    Import mutiple cvs-files into one sheet.

    Hi,

    I want to automate the import of multiple cvs-files(50+) to one sheet with same settings for all (i.e TextFilePlatform, Delimiters) and i want a new row where the filename of the imported data came from is presented.

    Is this possible in VBA? I dont have any vba-skill :/

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Import mutiple cvs-files into one sheet.

    Just to be clear. Your want:

    CSV FILE NAME 1
    csvfile data row 1
    csvfile data row 2
    ...
    csvfile data row n
    CSVFILE NAME 2
    csvfile data row 1
    csvfile data row 2
    ...
    csvfile data row n
    CSV FILE NAME 3
    ... etc.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Import mutiple cvs-files into one sheet.

    Also are all the files in the same directory and do you want to do all the CSV files in the directory or do you have a specific list of files you want to do?

  4. #4
    Registered User
    Join Date
    06-22-2016
    Location
    Malmo, Sweden
    MS-Off Ver
    2010
    Posts
    5

    Re: Import mutiple cvs-files into one sheet.

    Hi!---spaced out for a "while" on this issue I found https://sites.google.com/a/madrocket...svs-to-1-sheet
    wich is exactly want BUT I have to change the delimiter from "," to ";". How do I do that in this script?

  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: Import mutiple cvs-files into one sheet.

    You could try adding the line
    Please Login or Register  to view this content.
    before the last line in the macro for importing csv files.

    Csv files value will not be changed only the data in active excel sheet.

    Alf

  6. #6
    Registered User
    Join Date
    06-22-2016
    Location
    Malmo, Sweden
    MS-Off Ver
    2010
    Posts
    5

    Re: Import mutiple cvs-files into one sheet.

    Quote Originally Posted by Alf View Post
    You could try adding the line
    Please Login or Register  to view this content.
    before the last line in the macro for importing csv files.

    Csv files value will not be changed only the data in active excel sheet.

    Alf
    Thanks for your answer! But i dont think this is what i want. I dont want to change the value, I just want change the delimiter from comma to semicolon, so the values break up in columns at the semikolons instead of the commas in the import.
    Last edited by redone01; 10-18-2016 at 10:12 AM.

  7. #7
    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: Import mutiple cvs-files into one sheet.

    I just want change the delimiter from comma to semicolon, so the values break up in columns at the semikolons instead of the commas in the import.
    You need to set the parameters right i.e.

    Please Login or Register  to view this content.
    I would recommend you to record a macro importing one csv file to excel using the import wizard.

    Start by clicking "Record Macro" in "Developer's" tab. Then click "Data" tab and click "From Text" icon. Click on a csv file you wish to import, then button marked "Import".

    This will start the "Text Import Wizard". First step check that radio button "Delimited" is activated. Then click next. Select "Semicolon" and check that "Comma" is not activated.

    Click "Finish" and import result to say cell A1. Activate "Developers" tab and click "Stop Recording". Click on "Macros" icon and select "Edit". Copy macro code and post it then a forum member will help you to write a macro that loops through all files in that folder. Imports data from csv files and splits data using semicolon as delimiter.

    Imported data should start with csv file name, data split in columns based on semicolon. Then an empty row and then comes the next csv file name and data?

    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. Import Multiple Text Files into Same Sheet
    By loyalblue in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-12-2016, 08:52 AM
  2. [SOLVED] Import .txt files in Excel sheet, row by row
    By Flocom in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-06-2014, 02:13 AM
  3. Import all csv files in root sheet foler - name already used error
    By dweber100 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-05-2013, 01:02 PM
  4. [SOLVED] Import one column in many txt files in to one excel sheet
    By nhatruong306 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-20-2013, 05:55 AM
  5. Replies: 0
    Last Post: 01-06-2012, 07:09 AM
  6. Import mutiple CVS files
    By ptommy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-27-2007, 08:28 AM

Tags for this Thread

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