Sub
ImportTabelle1()
Dim
fd
As
Office.FileDialog
Dim
WSh
As
Worksheet
Dim
mldg
As
Variant
Set
WSh = ActiveWorkbook.Sheets(
"Tabelle1"
)
Set
fd = Application.FileDialog(msoFileDialogFilePicker)
With
fd
.Filters.Clear
.Title =
"Select a CSV File"
.Filters.Add
"CSV"
,
"*.csv"
, 1
.AllowMultiSelect =
False
Dim
sFile
As
String
If
.Show =
True
Then
sFile = .SelectedItems(1)
End
If
End
With
If
sFile <>
""
Then
With
Application
.ScreenUpdating =
False
.EnableEvents =
False
.Calculation = xlCalculationManual
End
With
Open sFile
For
Input
As
#1
row_number = 1
Do
Until
EOF(1)
Line Input #1, LineFormFile
LineItems = Split(LineFormFile,
";"
)
WSh.Cells(row_number, 1).Resize(1, UBound(LineItems) + 1) = LineItems
row_number = row_number + 1
Loop
Close #1
End
If
End
Sub