Sub 分表()
Dim cellall As Integer
FILENAMEA = ThisWorkbook.Name
Windows(FILENAMEA).Activate
Application.ScreenUpdating = False '关闭屏幕刷新
Application.DisplayAlerts = False '不进行警告确认
cellall = Application.WorksheetFunction.CountA(Sheets(1).Columns(1)) '数据表第一列不能为空否则将Columns(1)中的1修改为没有空格的列
a = 1
For i = 1 To Int(cellall / 100) + 1
Workbooks.Add
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & "数据表" & i & ".xls", FileFormat:=xlExcel8, ReadOnlyRecommended:=False, _
CreateBackup:=False
Windows(FILENAMEA).Activate
' Sheets("数据表").Rows(1).Copy Workbooks("数据表" & i & ".xls").Sheets(1).Rows(1)
Sheets("数据表").Range(Sheets("数据表").Rows(a), Sheets("数据表").Rows(a + 99)).Copy Workbooks("数据表" & i & ".xls").Sheets(1).Cells(1, 1)
a = a + 100
Windows("数据表" & i & ".xls").Activate
ActiveWindow.Close (True)
Next i
Application.ScreenUpdating = True '开启屏幕刷新
Application.DisplayAlerts = True '进行警告确认
Windows(FILENAMEA).Activate