|
Option Explicit
Sub TEST2()
Dim ar, br, cr, i&, j&, k&, r&, strSplit$
Application.ScreenUpdating = False
ar = ActiveSheet.UsedRange.Value
ReDim br(1 To UBound(ar) * 10, 1 To UBound(ar, 2))
For i = 1 To UBound(ar)
strSplit = Mid(ar(i, 7), 3)
cr = Split(strSplit, "+")
For j = 0 To UBound(cr)
r = r + 1
For k = 1 To UBound(ar, 2)
br(r, k) = ar(i, k)
Next k
br(r, 7) = ar(i, 5) & "-" & cr(j)
Next j
Next i
With Sheets(2)
.Cells.Delete
.[A1].Resize(r, UBound(br, 2)) = br
.Activate
End With
Application.ScreenUpdating = True
Beep
End Sub
|
|