|
Sub TXT()
Application.ScreenUpdating = False
p = ActiveWorkbook.Path & "/"
Cells.Clear
N = 1
For Each File In CreateObject("Scripting.FilesyStemObject").GetFolder(p).Files
If File.Name Like "*.txt" Then
S = CreateObject("Scripting.FileSystemObject").OpenTextFile(p & File.Name, 1, False).ReadAll()
A = Split(S, vbCrLf)
Cells(1, N) = File.Name
For I = 0 To UBound(A) - 1
Cells(I + 2, N) = Val(Mid(A(I), InStr(A(I), ",") + 1))
Next
N = N + 1
End If
Next
Application.ScreenUpdating = True
End Sub
|
评分
-
2
查看全部评分
-
|