谁能看到这个脚本有什么问题?
Option Explicit
Dim lrow As Long
Dim lcol As Long
Dim i As Long
Dim j As Long
Dim strow As Long
Dim fso As Object
Dim xl As Excel.Application
Dim wb As Object
Dim ws As Object
Dim f As Object
Dim Val As Object
Sub arrange_data()
Set fso = CreateObject("Scripting.FileSystemObject")
Set xl = CreateObject("Excel.Application")
Set wb = xl.Workbooks.Add
Set ws = wb.Sheets(1)
Set f = fso.OpenTextfile("<path to destination>\gg3-xtra.csv")
i = 1
j = 1
Do Until f.AtEndOfStream
Val = f.ReadLine
If Val = "" Then
i = 1
j = j + 1
Else
ws.Cells(i, j).Value = Val
i = i + 1
End If
Loop
f.Close
wb.SaveAs "output.xls"
End Sub
我希望此脚本执行以下操作
数据集现在的样子
数据集1
…</p>
…</p>
数据集2
..
..
数据集3
脚本应该使它看起来像什么
Dataset1 Dataset2 Dataset3
... … …
… … …
… … …