学習帳

VBAで特定シート以外すべて削除

公開:


'特定シート以外すべて削除
Dim tempSheet As Worksheet
With Application
    .DisplayAlerts = False
    For Each tempSheet In Worksheets
        If tempSheet.Name <> "設定" _
        And Not tempSheet.Name Like "【重要】*" _
        Then tempSheet.Delete
    Next
    .DisplayAlerts = True
End With


関連記事


スポンサーリンク