Sub sa()
Range("F:K") = ""
z = 0
r = 1
f = 1
For i = 1 To
Application.SumProduct(Application.Ceiling(Range("B1:B999"), 5)) +
5
z = z + 1
If z <= Cells(f, 2) Then
Cells(r, 6 + ((z + 4) Mod 5)) = Cells(f, 1)
End If
If (i Mod 5) = 0 Then
r = r + 1
End If
If Cells(f, 2) <= z And (i Mod 5) = 0
Then
f = f + 1
z = 0
Do Until Cells(f, 2) * 1 > 0
f = f + 1
Loop
End If
Next
End Sub