Sub Import_csv()
'Display Open Dialog to select csv location.
filenames = Application.GetOpenFilename("Excel Files (*.csv*)," & _
"*.csv*", 1, "Select CSV files", "Open", False)
'If the user cancels file selection then exit
If TypeName(filenames) = "Boolean" Then
Exit Sub
End If
'Set csv as SampleFile
FileCSV = Dir("*.csv")
'Cycle through the directory
Do While FileCSV <> ""
'Remove extension for sheetname, add sheet and rename
CSVNoext = (Left(FileCSV, Len(FileCSV) - 4))
'To import csvs into active WB adding new sheet same name as file without extn use '1'
'To import into existing sheets with same name no extn use '2'
'ThisWorkbook.Sheets.Add - 1
'ActiveSheet.Name = CSVNoext - 1
Workbooks.Open (FileCSV)
ActiveSheet.UsedRange.Copy
Application.DisplayAlerts = False
ActiveWorkbook.Close False
Application.DisplayAlerts = True
Worksheets(CSVNoext).Activate '- 2
ActiveSheet.PasteSpecial
FileCSV = Dir
Loop
End Sub