回答編集履歴
1
コード追加
test
CHANGED
@@ -13,3 +13,57 @@
|
|
13
13
|
・・・以下略
|
14
14
|
|
15
15
|
```
|
16
|
+
|
17
|
+
コメントに対する回答
|
18
|
+
|
19
|
+
---
|
20
|
+
|
21
|
+
> この書き方に追加で列を指定することはできませんでしょうか?
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
34行目5列目(E34)が出力先の起点だとして、
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
```vba
|
30
|
+
|
31
|
+
Sub Sample()
|
32
|
+
|
33
|
+
Open "C:\Users******\test.csv" For Input As #1
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
Dim r As Long, c As Long
|
38
|
+
|
39
|
+
r = 34
|
40
|
+
|
41
|
+
c = 5
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
Dim buf As String, tmp As Variant
|
46
|
+
|
47
|
+
Do Until EOF(1)
|
48
|
+
|
49
|
+
Line Input #1, buf
|
50
|
+
|
51
|
+
tmp = Split(buf, ",")
|
52
|
+
|
53
|
+
r = r + 1
|
54
|
+
|
55
|
+
Cells(r, c).Value = tmp(0)
|
56
|
+
|
57
|
+
Cells(r, c + 1).Value = tmp(1)
|
58
|
+
|
59
|
+
Cells(r, c + 2).Value = tmp(2)
|
60
|
+
|
61
|
+
Loop
|
62
|
+
|
63
|
+
Close #1
|
64
|
+
|
65
|
+
End Sub
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
```
|