|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub test() '过年好
- Dim strPath As String, strFile As String
- Dim ar(98765, 4), br, cr
- Dim i As Long, j As Long, k As Long, n As Byte
- strPath = ThisWorkbook.Path & "\"
- strFile = Dir(strPath & "*.txt")
- While Len(strFile)
- n = FreeFile
- Open strPath & strFile For Input As #n
- br = Split(StrConv(InputB(LOF(n), #n), vbUnicode), vbCrLf)
- Close #n
- For i = LBound(br) To UBound(br)
- If Len(br(i)) Then
- cr = Split(Replace(br(i), String(2, Chr(9)), Chr(9)), Chr(9))
- For j = LBound(cr) To UBound(cr)
- ar(k, j) = cr(j)
- Next
- k = k + 1
- End If
- Next
- strFile = Dir
- Wend
- Range("A1").Resize(k, 3) = ar
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|