Did you try:
Code:
Sub M_snb()
sn = Cells(1).CurrentRegion
sp = Cells(1).CurrentRegion.Resize(, 10)
c00 = 1
For j = 2 To UBound(sn)
If (LCase(sn(j, 1))) = "accrue" Then c00 = c00 & Replace(String(17, "|"), "|", "|" & j)
Next
sq = Application.Index(sp, Application.Transpose(Split(c00, "|")), [transpose(row(1:10))])
For j = 2 To UBound(sq)
sq(j, 9) = sn(1, 8 + (j - 2) Mod 17 + 1)
sq(j, 10) = sn((j + 15) \ 17 + 1, 8 + (j - 2) Mod (17) + 1)
Next
Cells(40, 1).Resize(UBound(sq), UBound(sq, 2)) = sq
End Sub
Bookmarks