回答編集履歴
1
追記
test
CHANGED
@@ -61,3 +61,61 @@
|
|
61
61
|
※こんな感じかなぁというイメージです。
|
62
62
|
|
63
63
|
動作確認は行ってません。細かい計算など修正願います。
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
---
|
68
|
+
|
69
|
+
画像見ました。
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
僕ならこんな感じで書きます。(いろんな書き方があります)
|
74
|
+
|
75
|
+
```ExcelVBA
|
76
|
+
|
77
|
+
Sub test003()
|
78
|
+
|
79
|
+
Dim rngFrom As Range
|
80
|
+
|
81
|
+
Dim rngTo As Range
|
82
|
+
|
83
|
+
Dim c As Range
|
84
|
+
|
85
|
+
Dim ixMin As Long
|
86
|
+
|
87
|
+
Dim ixMax As Long
|
88
|
+
|
89
|
+
Dim ix As Long
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
With Worksheets("Sheet1").Range("C5").CurrentRegion
|
94
|
+
|
95
|
+
Set rngFrom = Intersect(.Cells, .Offset(1), .Columns(2))
|
96
|
+
|
97
|
+
ixMin = .Worksheet.Range("F3").Value
|
98
|
+
|
99
|
+
ixMax = .Worksheet.Range("D3").Value
|
100
|
+
|
101
|
+
End With
|
102
|
+
|
103
|
+
Set rngFrom = Application.Range(rngFrom(ixMin), rngFrom(ixMax))
|
104
|
+
|
105
|
+
Set rngTo = Worksheets("マクロ用書き出し").Range("A9")
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
ix = 1
|
110
|
+
|
111
|
+
For Each c In rngFrom
|
112
|
+
|
113
|
+
c.Copy rngTo(ix, 1)
|
114
|
+
|
115
|
+
ix = ix + 2
|
116
|
+
|
117
|
+
Next
|
118
|
+
|
119
|
+
End Sub
|
120
|
+
|
121
|
+
```
|