アクティブシート以外のシートをすべて無条件に削除する
 サンプルマクロは、アクティヴシート以外のシートを警告なしに削除します。

Sub Sample()

    Dim mySht As Worksheet

    With Application
        .DisplayAlerts = False
    For Each mySht In Worksheets
        If mySht.Name <> ActiveSheet.Name Then mySht.Delete
    Next
        .DisplayAlerts = True
    End With

End Sub

Excel95/97/2000



戻る


Excel Word Access VBA! モーグ