|
Sub limonet()
Dim objFSO As Object, objStream As Object, i%, j%
Set objFSO = CreateObject("Scripting.FileSystemObject")
j = Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To j
If Cells(i, "A") <> "" And Cells(i, "B") = "" Then
Set objStream = objFSO.CreateTextFile(ThisWorkbook.Path & "\" & Cells(i, "A") & ".txt", True)
Else
Do Until Cells(i, "B") = ""
objStream.WriteLine Join(Application.Transpose(Application.Transpose(Range(Cells(i, "A"), Cells(i, "D")))), vbTab)
i = i + 1
Loop
objStream.Close
If i < j Then
Set objStream = objFSO.CreateTextFile(ThisWorkbook.Path & "\" & Cells(i, "A") & ".txt", True)
Else
Exit Sub
End If
End If
Next i
End Sub
|
评分
-
1
查看全部评分
-
|