Option Explicit
Sub abc()
Dim a, i, j, m, n, t
ReDim a(1 To 1617) '报告单总数
For i = 1 To UBound(a)
a(i) = i
Next
For i = 1 To UBound(a)
n = Int(Rnd * UBound(a)) + 1
t = a(i): a(i) = a(n): a(n) = t
Next
n = 30 '指定月天数
If n < 28 Or n > 31 Then MsgBox "!": Exit Sub
ReDim b(1 To n, 1 To UBound(a) \ n + 1)
For i = 1 To UBound(a) Step UBound(a) \ n
m = m + 1
For j = i To i + UBound(a) \ n - 1
b(m, j - i + 1) = a(j)
Next
If m = UBound(b) Then Exit For
Next
m = 0
For i = UBound(a) - (UBound(a) Mod n) + 1 To UBound(a)
m = m + 1
b(m, UBound(b, 2)) = a(i)
Next
[a1].Resize(UBound(b), UBound(b, 2)) = b
End Sub