Hallo Leute,
unten stehendes Makro ist von Hans.
Ich müßte dieses etwas modifizieren, kann es aber selbst nicht.
Die Datei Dat1.txt enthält ca. 250.000 Datensätze (Zeilen).
Diese Datei soll so eingelesen werden,
daß die Daten dann in Excel auf ca. 4 Tabellenblätter verteilt werden.
Kann mir hier jemand helfen?
Vielen Dank im voraus
Gruß Frank
Sub TwoSheets()
Dim lngRow As Long
Dim test As Integer
Dim txt As String
Application.ScreenUpdating = False
Close
Open "Dat1.txt" For Input As #1
Do Until EOF(1)
Line Input #1, txt
lngRow = lngRow + 1
Loop
Close
Workbooks.OpenText FileName:="Dat1.txt", Origin:=xlWindows, StartRow:=32767, DataType:=xlFixedWidth, FieldInfo:=Array(0, 1)
With ThisWorkbook
ActiveSheet.Move after:=.Worksheets(.Worksheets.Count)
End With
ActiveSheet.Name = "Blatt2"
Application.DisplayAlerts = False
Workbooks.OpenText FileName:="Dat1.txt", Origin:=xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(0, 1)
Application.DisplayAlerts = True
ActiveSheet.Move after:=ThisWorkbook.Worksheets(1)
ActiveSheet.Name = "Blatt1"
Rows("32767:65536").Delete
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub