|
Option Explicit
Sub TEST1()
Dim ar, br(), i&, j&, k&, r&, strJoin$
With [H5].CurrentRegion
ar = .Value
For i = 1 To UBound(ar) Step 6
r = r + 1
ReDim Preserve br(1 To r)
br(r) = .Cells(i, 1).Resize(6).Value
Next i
End With
ReDim ar(1 To UBound(br) * 3, 0)
r = 0
For i = 1 To UBound(br)
For j = 1 To 2
strJoin = ""
For k = j To UBound(br(i)) Step 2
strJoin = strJoin & " " & br(i)(k, 1)
Next k
r = r + 1
ar(r, 0) = r & " =" & strJoin
Next j
r = r + 1
ar(r, 0) = r & "= " & br(i)(1, 1) & " " & br(i)(4, 1) & " " & br(i)(5, 1)
Next i
[O5].Resize(UBound(ar)) = ar
Beep
End Sub
|
|