|
>列はAとBの2列
この2列にどのように割り振るのか、そのルールが分からないと
途中までの処理しか回答できません。なのでいちおう、D1から下へ
1列に並べてみるとして・・
Sub MyData_Splt()
Dim St As String
Dim i As Long, Cnt As Long
Dim Ary As Variant
Dim C As Range
With Worksheets("Sheet1")
For Each C In .Range("A2", .Range("A65536").End(xlUp))
Cnt = C.Offset(, 1).Value
If Cnt > 0 Then
For i = 1 To Cnt
St = St & C.Value & ","
Next i
End If
Next
St = Left$(St, Len(St) - 1)
Ary = WorksheetFunction.Transpose(Split(St, ","))
.Range("D1").Resize(UBound(Ary)).Value = Ary
End With
Erase Ary
End Sub
|
|