Sub 拆分行数()
Dim I As Long, N As Long
Dim C As Long, Sh As Worksheet
Application.ScreenUpdating = False
C = Val(InputBox("请输入数据拆分行数"))
If C = 0 Then Exit Sub
Set Sh = ThisWorkbook.Worksheets(1)'要拆分的表'
For I = 1 To ThisWorkbook.Worksheets(1).UsedRange.Rows.Count Step C
With ThisWorkbook.Worksheets.Add(after:=Worksheets(ThisWorkbook.Worksheets.Count))
Sh.Rows(I).Resize(C).Copy .Range("A1")
N = N + 1
.Name = N
End With
Next
Application.ScreenUpdating = True
MsgBox "共拆分出 " & N & "个工作表"
End Sub
Sub split()
Dim i&
For i =1 To 2000 Step 500
Sheets.Add after:=Sheets(Sheets.Count)Sheets(Sheets.Count).Name = i
Range("a"& i &":iv"& i +499).Copy Sheets(Sheets.Count).[a1]
Next i
End Sub