|
1行目のみ、タイトルとデータを分離すれば良いのでしょーか ?
それなら
Sub データ取込()
Dim i As Long, j As Long
Dim Ary As Variant
Dim Buf As String
Const fname As String "C:\Temp\Test.csv"
'↑適当に変更して下さい。
i = 1
Open fname For Input Access Read As #1
Do Until EOF(1)
Line Input #1, Buf
Ary = Split(Buf, ",")
If i = 1 Then
For j = 0 To 3
Cells(1, j + 1).Value = Ary(j)
Next j
For j = 4 To 11
Cells(2, j + 1).Value = Ary(j)
Next j
i = i + 2
Else
Cells(i, 1).Resize(, UBound(Ary) + 1).Value = Ary
i = i + 1
End If
Erase Ary
Loop
Close #1
End Sub
で、どうかな ?
|
|