-1
任何人都可以看到這個腳本有什麼問題嗎?vba在csv中格式化/解析數據集
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
我想這個腳本來執行以下操作
數據集是什麼樣子,現在
dataSet1的
...
...
Dataset2
..
..
Dataset3
什麼腳本應該使它看起來像
Dataset1 Dataset2 Dataset3
... … …
… … …
… … …