VBA批量增加工作表
Sub 批量增加工作表() Dim i As Integer For i = 1 To 10 '每次都在最后一张表后面增加 Worksheets.Add after:=Sheets(Worksheets.Count), Count:=1 ActiveSheet.Name = Sheet1.Range("a" & i).Text '提取单元格文本用作新工作表名 Next End Sub
Sub 批量删除工作表() Excel.Application.DisplayAlerts = False '取消excel警告 Dim i As Integer For i = Sheets.Count To 2 Step -1 '从最后一张表开始删除 Sheets(i).Delete Next End Sub