Sub 日报表格式生成()
Dim sh As Worksheet, n%, x As Integer
Sheets("日报表模板").Visible = True
For x = 1 To Sheets.Count
n = n + 1
Next
Sheets("日报表模板").Copy after:=Sheets(Sheets.Count)
Set sh = ActiveSheet
sh.Name = n - 1 & "日报表"
Sheets("日报表模板").Visible = False
End Sub
Sub 另存报表()
Application.DisplayAlerts = False
Dim wb As Workbook, sh As Worksheet, x%
For x = 1 To Sheets.Count
Set sh = Sheets(x)
Set wb = ActiveWorkbook
If sh.Name = x - 2 & "日报表" Then
Sheets(x - 2 & "日报表").Copy
Set wb = ActiveWorkbook
wb.SaveAs ThisWorkbook.Path & "/" & x - 2 & "日报表.xls"
wb.Close True
End If
Application.DisplayAlerts = True
Next x
End Sub