添加和删除工作表

'添加工作表

Sub Addsh_2()
    Dim i As Integer
    Dim sh As Worksheet
    For i = 1 To 10
        Set sh = Sheets.Add(after:=Sheets(Sheets.Count))
        sh.Name = i
    Next
End Sub

'删除工作表

Sub Delsh()
    Dim sh As Worksheet
    For Each sh In ThisWorkbook.Sheets
        If sh.Name <> "工作表的添加与删除" Then
            Application.DisplayAlerts = False
            sh.Delete
            Application.DisplayAlerts = True
        End If
    Next
End Su

上一篇:468. 验证IP地址


下一篇:ansible使用,常用模块