Sub test()
Dim ws As Worksheet, i As Long, rw As Long, D
For Each ws In Sheets
If ws.Range(\u0026quot;A1\u0026quot;) \u0026amp; \u0026quot; \u0026quot; \u0026amp; ws.Range(\u0026quot;A2\u0026quot;) = \u0026quot;品番 カラー\u0026quot; Then
rw = ws.Cells(Rows.Count, 1).End(xlUp).Row
ReDim D(1 To rw - 2, 1 To 5)
For i = 3 To rw
D(i - 2, 1) = ws.Cells(1, 2)
D(i - 2, 2) = ws.Cells(i, 1)
D(i - 2, 3) = ws.Cells(i, 2)
D(i - 2, 4) = ws.Cells(1, 4)
D(i - 2, 5) = ws.Cells(i, 3)
Next
Sheets(\u0026quot;Datum\u0026quot;).Cells(Rows.Count, 1).End(xlUp).Offset(1).Resize(rw - 2, 5) = D
Erase D
End If
Next
End Sub
※データ収集のシートの判定は
A1が品番、A2がカラー,の見出しが入っていることを条件にしています。