Sub
DateienLesen()
Call
EventsOff
Dim
DateiName
As
String
DateiName = Dir(
"C:\Tmp\test_txt\" & "
*.txt")
Do
While
DateiName <>
""
With
ActiveSheet.QueryTables.Add(Connection:=
"TEXT;C:\Tmp\test_txt\" & DateiName, Destination:=Range("
C" & ActiveSheet.Cells(Rows.Count, 3).
End
(xlUp).Row + 1))
.Name = DateiName
.FieldNames =
True
.RowNumbers =
False
.FillAdjacentFormulas =
False
.PreserveFormatting =
True
.RefreshOnFileOpen =
False
.RefreshStyle = xlInsertDeleteCells
.SavePassword =
False
.SaveData =
True
.AdjustColumnWidth =
True
.RefreshPeriod = 0
.TextFilePromptOnRefresh =
False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter =
False
.TextFileTabDelimiter =
True
.TextFileSemicolonDelimiter =
False
.TextFileCommaDelimiter =
False
.TextFileSpaceDelimiter =
False
.TextFileColumnDataTypes = Array(1)
.Refresh BackgroundQuery:=
False
End
With
DateiName = Dir
Loop
Call
EventsOn
End
Sub
Public
Sub
EventsOff()
With
Application
.ScreenUpdating =
False
.EnableEvents =
False
.Calculation = xlCalculationManual
End
With
End
Sub
Public
Sub
EventsOn()
With
Application
.ScreenUpdating =
True
.EnableEvents =
True
.Calculation = xlCalculationAutomatic
End
With
End
Sub