• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Import multiple .csv files to Excel with semi-colon delimiter

Cris0213

New Member
I have 42 csv files, May I ask if who can help me create a VBA code that will

1. Import multiple csv file.
2. Semi-Colon delimiter
3. See attached sample output (From text, import csv, delimited, semi colon as delimiter)

I tried so many codes but some fields are missing. I need a VBA code that will not affect the fields and data.

I have also attached the code I used and output that is not correct. Some data missing starts on column Q - BD
 

Attachments

  • test file.xlsx
    19.3 KB · Views: 3
  • Vba Code used.txt
    2.3 KB · Views: 1
  • output file from macro.xlsx
    15.6 KB · Views: 4
Cris0213
If You're asking support to import 'some' .csv-files then should You able to upload at least one .csv-file for reference?
... any of those Your files are not .csv-files.
Are Your .csv-files in same folder or how to know - which files should import?
Is Your output file from macro.xlsx as expected output or as You've written - Your macro won't work correct?
 
Cris0213
If You're asking support to import 'some' .csv-files then should You able to upload at least one .csv-file for reference?
... any of those Your files are not .csv-files.
Are Your .csv-files in same folder or how to know - which files should import?
Is Your output file from macro.xlsx as expected output or as You've written - Your macro won't work correct?

attached is the sample file to import. I have plenty of csv files like this. And I would like to know if there is a code that can be written to the following

1. import multiple csv fles
2. Semi-Colon delimiter
3. See format of the output file, it should be like that if my question is possible.
4. Each csv files should go on different sheets, (create new sheet if there is not enough)

Attached is the sample CSV that I have.

- All csv files are in the same folder.

Output file should be the same format as output file from macro.xlsx (attached on previous post).

My macro work but doesn't allow me to

-Keep the formatting on each sheet
-some fields are missing(Missing data)

But it can
- import multiple csv
- create new sheet, equal to the number of csv imported.

I hope you can help me out. Thank you so much in advance.
 

Attachments

  • Test csv.csv
    22 KB · Views: 0
  • Test csv 1.csv
    22 KB · Views: 1
Cris0213
About Your: I have also attached the code I used and output that is not correct.
Should You upload here output -file - - which is correct?

You wrote that use
Semi-Colon delimiter ... there has used Semi-Colons for other use too ... hmm? (eg with 9th row)
Screenshot 2020-12-16 at 14.46.15.png
 
Last edited:
Back
Top