回答編集履歴
1
追記
test
CHANGED
@@ -91,3 +91,101 @@
|
|
91
91
|
|
92
92
|
|
93
93
|
目的のデータ範囲が取得できるよう、データ範囲の選択方法を検討してください。
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
追記
|
100
|
+
|
101
|
+
---
|
102
|
+
|
103
|
+
私が動作確認したソースです。
|
104
|
+
|
105
|
+
ynakanoさん提示のソースに少し手を加えた内容です。
|
106
|
+
|
107
|
+
```
|
108
|
+
|
109
|
+
Dim shtRead As Worksheet
|
110
|
+
|
111
|
+
Set shtRead = Sheets("入力")
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
Dim iReadRow As Integer
|
116
|
+
|
117
|
+
Dim iWriteRow As Integer
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
Dim strShtName As String
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
'入力シートのデータをループ処理
|
126
|
+
|
127
|
+
For iReadRow = 3 To shtRead.Cells(Rows.Count, 3).End(xlUp).Row
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
Select Case shtRead.Cells(iReadRow, 3).Value
|
132
|
+
|
133
|
+
Case "1.Aチーム"
|
134
|
+
|
135
|
+
strShtName = "Aチーム"
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
Case "2.Bチーム"
|
140
|
+
|
141
|
+
strShtName = "Bチーム"
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
Case "3.Cチーム"
|
146
|
+
|
147
|
+
strShtName = "Cチーム"
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
Case "4.Dチーム"
|
152
|
+
|
153
|
+
strShtName = "Dチーム"
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
Case "5.Eチーム"
|
158
|
+
|
159
|
+
strShtName = "Eチーム"
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
Case Else
|
164
|
+
|
165
|
+
strShtName = ""
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
End Select
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
'シート名が取得できたらコピーを行う
|
174
|
+
|
175
|
+
If strShtName <> "" Then
|
176
|
+
|
177
|
+
'出力シートの最終行+1を取得
|
178
|
+
|
179
|
+
iWriteRow = Sheets(strShtName).Cells(Rows.Count, 1).End(xlUp).Row + 1
|
180
|
+
|
181
|
+
'入力シートから出力シートへコピー
|
182
|
+
|
183
|
+
shtRead.Range(shtRead.Cells(iReadRow, 3), shtRead.Cells(iReadRow, 33)).Copy Destination:=Sheets(strShtName).Cells(iWriteRow, 1)
|
184
|
+
|
185
|
+
End If
|
186
|
+
|
187
|
+
Next
|
188
|
+
|
189
|
+
```
|
190
|
+
|
191
|
+
|