- ©«¤l
- 976
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 1018
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-4-19
- ³Ì«áµn¿ý
- 2024-10-30
|
¦^´_ 15# wang077
½Ð¦A´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ
Sub test2()
Dim Arr, Ar(), N%, M%, x%, y%
Arr = Range([a1], [a65536].End(3))
M = Int(UBound(Arr) / 5): x = 1: y = 2
If M < 1 Then
Cells(x, y).Resize(, UBound(Arr)) = Application.Transpose(Arr)
Else
For i = 1 To UBound(Arr)
ReDim Ar(1 To M)
If N = UBound(Arr) Then GoTo 99
If N = M * 5 Then
ReDim Ar(1 To UBound(Arr) - N)
For j = 1 To UBound(Arr) - N: N = N + 1: Ar(j) = Arr(N, 1): Next
Cells(x, y).Resize(, UBound(Ar)) = Ar: Exit For
End If
For j = 1 To M: N = N + 1: Ar(j) = Arr(N, 1): Next
Cells(x, y).Resize(UBound(Ar), 1) = Application.Transpose(Ar)
Erase Ar
If y < 6 Then y = y + 1 Else x = x + M: y = 2
99: Next
End If
End Sub |
|