Sub
ImpIt()
Dim
strFileName
As
String
Dim
Rng
As
Range
With
Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect =
False
.Filters.Add
"CSV-Dateien"
,
"*.csv"
, 1
If
.Show = -1
Then
strFileName = .SelectedItems(1)
Else
Exit
Sub
End
If
End
With
Select
Case
MsgBox(
"Alles löschen?"
, vbQuestion + vbYesNo)
Case
vbYes
Cells.Clear
Set
Rng = Cells(1)
Case
vbNo
Set
Rng = Cells(1).
End
(xlDown).Offset(1)
Case
Else
Exit
Sub
End
Select
With
ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;"
& strFileName, Destination:=Rng)
.RowNumbers =
False
.FillAdjacentFormulas =
False
.RefreshStyle = xlInsertDeleteCells
.SavePassword =
False
.SaveData =
True
.AdjustColumnWidth =
True
.RefreshPeriod = 0
.TextFilePlatform = 65001
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileSemicolonDelimiter =
True
.Refresh BackgroundQuery:=
False
End
With
End
Sub