|
Sub demo()
Row = 4 '定義列數
col = 8 '定義行數
Group = 100 ' 定義幾個一組
s = 1
For i = 11 To [a65536].End(xlUp).Row
If Sheets(1).Cells(i, 1) Then
r = r + 1
If r = Row Then
If c = 0 Then
s = s + 1
Sheets.Add(after:=Sheets(Worksheets.Count)).Name = "Sheet" & s
t = 5
End If
arr = Application.Transpose(Sheets(1).Cells(i - Row + 1, 1).Resize(Row, col))
Cells(1, t).Resize(col, Row) = arr
r = 0: c = c + 1: t = t + Row + 1
If c = Group Then c = 0
End If
End If
Next
End Sub
祝順心,南無阿彌陀佛!
|
|