excel如何将一个工作表按固定的行数分成多个工作薄

2024-12-18 16:30:40
推荐回答(2个)
回答1:

新工作簿保存在d:\
Sub 统计()
Dim I As Integer, zROW As Integer, zN As Integer
Dim zNAME As String, zPATH As String

ActiveWindow.Caption = "汇总"

zN = 1

'******下面zROW=的是你要打印的行数

zROW = 5

Range("A1").Select

Do Until ActiveCell = ""

Workbooks.Add

Application.DisplayAlerts = False

ActiveWindow.Caption = "BOOK"

Do Until Sheets.Count = 1

Sheets(2).Delete

Loop

Application.DisplayAlerts = True

Windows("汇总").Activate

Rows(ActiveCell.Row & ":" & ActiveCell.Row + zROW - 1).Copy

Windows("BOOK").Activate

Range("A1").Select

ActiveSheet.Paste

ChDir "D:"

ActiveWorkbook.SaveAs Filename:="D:\" & zN & ".xls", FileFormat:=xlNormal

ActiveWindow.Close

ActiveCell.Offset(zROW).Select

zN = zN + 1

Loop
End Sub

回答2:

如何将一张工作表拆分成多个工作表?