Option
Explicit
Public
Sub
test()
Dim
DatNR
As
Long
Dim
Dateiname
As
String
Dim
inhalt
As
String
Dim
astrTemp()
As
String
, astrOutput()
As
String
Dim
strInhalt
As
String
Dim
ialngIndex
As
Long
, lngColumn
As
Long
, lngRow
As
Long
DatNR = FreeFile
Dateiname =
"C:\Users\Desktop\vba\test.txt"
Open Dateiname
For
Input
As
DatNR
inhalt = Input(LOF(DatNR), DatNR)
Close DatNR
inhalt = Trim(Split(inhalt,
"Node"
)(1))
If
InStr(1, inhalt,
"*Extra"
, vbTextCompare) > 1
Then
inhalt = Trim(Split(inhalt,
"*Extra"
)(0))
End
If
inhalt = Replace(inhalt,
","
,
""
)
inhalt = Replace(inhalt,
". "
,
" "
)
MsgBox inhalt
Application.ScreenUpdating =
False
strInhalt = Sheet3.TextBox1.inhalt
astrTemp = Split(Expression:=strInhalt, Delimiter:=vbCrLf)
For
ialngIndex = 0
To
UBound(astrTemp)
Step
2
lngRow = lngRow + 1
astrOutput = Split(Expression:=astrTemp(ialngIndex), Delimiter:=
" "
)
Cells(lngRow, 1).Resize(1, UBound(astrOutput) + 1).Value = astrOutput()
Next
With
Cells(1, 1).Resize(ialngIndex, UBound(astrOutput) + 1)
For
lngColumn = 1
To
.Columns.Count
With
.Columns(lngColumn)
Call
.TextToColumns(Destination:=.Cells(1, 1), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=
False
, Tab:=
True
, _
Semicolon:=
False
, Comma:=
False
, Space:=
False
, Other:=
False
, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=
True
)
End
With
Next
End
With
Application.ScreenUpdating =
True
End
Sub