|
- Sub 设置批量表()
- Dim arr, i&, j&, Sht As Worksheet, Wb As Workbook
- Application.DisplayAlerts = False
- Application.ScreenUpdating = False
- Sheets(1).Activate
- arr = [a1].CurrentRegion
- Sheets("模板").Copy after:=Sheets(Sheets.Count)
- Set Sht = ActiveSheet
- For i = 2 To UBound(arr)
- Sht.Name = arr(i, 1) & " " & arr(i, 2) & " 打分表"
- [b1] = arr(i, 1)
- [b2] = arr(i, 2)
- [a4] = arr(i, 3)
- [a5] = arr(i, 4)
- [a6] = arr(i, 5)
- [a7] = arr(i, 6)
- Sht.Copy
- Set Wb = ActiveWorkbook
- Wb.SaveAs ThisWorkbook.Path & "" & Sht.Name & ".xlsx"
- Wb.Close True
- Next
- Sheets(3).Delete
- Sheets(1).Select
- Application.ScreenUpdating = True
- Application.DisplayAlerts = True
- End Sub
复制代码 |
|