- Private Sub CommandButton1_Click()
- [d2:ho3].ClearContents: [d6:iv60000].ClearContents
- Application.ScreenUpdating = False
- Dim txt As Object, TextLine As String, Fn As Variant, b() As Byte
- filepath = ThisWorkbook.Path & Application.PathSeparator & "结果" & Application.PathSeparator
- Fn = Dir(filepath)
- Do While Fn <> ""
- n = n + 1
- Cells(3, n + 3) = Left(Fn, InStr(Fn, ".") - 1)
- Open filepath & Fn For Input As #1
- arr = Split(Replace(Replace(Replace(StrConv(InputB$(LOF(1), 1), vbUnicode), " ", ","), vbCrLf, ","), ",,", ","), ",")
- Close #1
- Cells(6, n + 3).Resize(UBound(arr), 1) = WorksheetFunction.Transpose(arr)
- Cells(2, n + 3) = UBound(arr)
- Fn = Dir
- Loop
- Application.ScreenUpdating = True
- End Sub
复制代码 |