Sub
read()
Dim
NLine
As
Integer
Dim
NCol
As
Integer
Dim
KWrite
As
String
Open
"C:\Temp\test.txt"
For
Input
As
#1
NLine = 1
Do
While
Not
EOF(1)
Line Input #1, KWrite
If
Len(KWrite) > 0
Then
If
InStr(1, KWrite,
" "
) = 0
Then
Cells(NLine, 1) = KWrite
Else
NCol = 1
Do
While
InStr(1, KWrite,
" "
) > 0
MsgBox KWrite
Cells(NLine, NCol) = Mid(KWrite, 1, InStr(1, KWrite,
" "
))
KWrite = Mid(KWrite, InStr(1, KWrite,
" "
) + 1)
NCol = NCol + 1
Loop
Cells(NLine, NCol) = KWrite
End
If
NLine = NLine + 1
End
If
Loop
Close #1
End
Sub