Multiple csv file importer

Vbanoob98

Board Regular
Joined
Sep 13, 2019
Messages
119
Hello,

I am trying to come up with a macro that imports multiple csv files to different sheets and using the name of the file as the sheet name.

I also need to be able to select the delimiter and also Consecutive delimiters. I have found 2 variants, one that imports multiple files but does not keep the name of the file and one that keeps the name but doesnt have the ability to set consecutive delimiters.

I also need to be able to choose the folder in which the files are

https://www.extendoffice.com/documents/excel/3230-excel-import-multiple-csv-files.html

Thanks again for your help, this forum is great​
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Fennek

Active Member
Joined
Nov 21, 2016
Messages
279
Hi,

IT-guys like it difficult, but your link is crossing all limits.

An easy way:
Code:
Sub T_1()
With Application.FileDialog(msoFileDialogFilePicker)
    .AllowMultiSelect = True
    .InitialFileName = "c:\temp\*.csv"
    If .Show Then
        For Each f In .SelectedItems
            Sheets.Add , Sheets(Sheets.Count), , f
        Next f
    End If
End With
End Sub

regards
 

Vbanoob98

Board Regular
Joined
Sep 13, 2019
Messages
119
Thank you! The only thing that I can't figure is how to set the delimiter as a semicolon for example. Otherwise the data is all in the wrong places
 

Watch MrExcel Video

Forum statistics

Threads
1,132,677
Messages
5,654,701
Members
418,149
Latest member
tjanok

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top