|
Private Sub S() '书生答题专用
Call 加速(False)
Dim i, j, k, arr, brr, x, y
h = Cells(Rows.Count, 1).End(xlUp).Row
m = ThisWorkbook.Name
For i = 1 To h Step 6
a = Cells(i + 5, 2) & ".xlsx"
Workbooks.Add
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "" & a
Workbooks(m).Activate
Range(Cells(i + 1, 1), Cells(i + 5, 27)).Copy
Workbooks(a).Activate
Range("A2").Select
ActiveSheet.Paste
Range("A1") = "工资表"
Range("A1:a9").RowHeight = 22
Range("A1:z1").Merge
Range("A1:z1").HorizontalAlignment = xlCenter
ActiveWorkbook.Close True
Next
Call 加速(True)
End Sub
Public Function 加速(开关 As Boolean)
If 开关 Then
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.DisplayAlerts = True
Application.Calculation = xlCalculationAutomatic
Else
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
End If
End Function |
|