|
▼からす さん:
こんにちは
たえば、
Sub Sample()
Dim v As Variant
Dim w() As Variant
Dim i As Long, j As Long, k As Long
With Sheets("Sheet1")
v = .Range("A1").CurrentRegion.Offset(1).Value
ReDim w(1 To WorksheetFunction.Sum(.Columns("C")), 1 To 3)
End With
For i = LBound(v, 1) To UBound(v, 1)
For j = 1 To v(i, 3)
k = k + 1
w(k, 1) = v(i, 1)
w(k, 2) = v(i, 2)
w(k, 3) = j
Next
Next
With Sheets("Sheet2")
.UsedRange.ClearContents
.Range("A1:C1").Value = Array("No", "種類", "カウントダウン")
.Range("A2").Resize(UBound(w, 1), UBound(w, 2)).Value = w
End With
End Sub
|
|