|
Option Explicit
Sub test()
Dim i, j, arr, n, t
Open ThisWorkbook.Path & "\文本内容.txt" For Input As #1
arr = Split(StrConv(InputB(LOF(1), 1), vbUnicode), vbNewLine)
Close #1
For i = 0 To UBound(arr)
If InStr(arr(i), vbTab) Then
t = Split(arr(i), vbTab)
If i = 0 Then ReDim brr(1 To UBound(arr) + 1, 1 To UBound(t) + 1)
n = n + 1
For j = 0 To UBound(t)
brr(n, j + 1) = t(j)
Next
End If
Next
With [a1]
.Resize(Rows.Count, UBound(brr, 2)).ClearContents
If n > 0 Then .Resize(n, UBound(brr, 2)) = brr
End With
End Sub |
评分
-
1
查看全部评分
-
|