软件:excel
版本:2007
我从网络上收集到一个vba
Sub ReadTxtByInput01()
Dim myFile$, Jm, AA$, uMax&, xArr(), xR As Range
myFile = ThisWorkbook.Path & "\" & "stas.txt"
Set xR = [A1]
uMax = 65500
Cells.ClearContents
Open myFile For Input As #1
Do While Not EOF(1)
Line Input #1, AA
If Jm = 0 Then ReDim xArr(1 To uMax, 0)
Jm = Jm + 1: xArr(Jm, 0) = AA
If Jm = uMax Then
xR.Resize(uMax).Value = xArr
Jm = 0: Set xR = xR(1, 3)
End If
Loop
Close #1
If Jm > 0 Then xR.Resize(uMax).Value = xArr
Erase xArr
End Sub
我想问的是
如果我只想更动:
1. 汇入的文字档案用 "," 当分隔
2. 分割的每个部分都分配到不同的新增工作表
不知道这样要怎么修改??