Sub savetofile()
Application.ScreenUpdating = False
on error resume next '忽略错误,继续执行
Dim folder As String
folder = ThisWorkbook.Path & "\班级成绩表"
If Len(Dir(folder, vbDirectory)) = 0 Then MkDir folder
Dim sht As Worksheet
For Each sht In thisworkbook.Worksheets
if sht.name<>"成绩表" then '判断表名
sht.Copy
ActiveWorkbook.SaveAs folder & "\" & sht.Name & ".xlsx"
ActiveWorkbook.Close
end if
Next
Application.ScreenUpdating = True
End Sub