Results 1 to 2 of 2

delete all sheets except active sheet

This is a discussion on delete all sheets except active sheet within the Excel Questions forums, part of the Question Forums category; how to delete all sheets except active sheet. thanks in advance....

  1. #1
    Board Regular
    Join Date
    Jun 2002
    Posts
    102

    Default delete all sheets except active sheet

    how to delete all sheets except active sheet. thanks in advance.

  2. #2
    MrExcel MVP Tom Urtis's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, California USA
    Posts
    11,078

    Default Re: delete all sheets except active sheet

    One way:

    Sub Test()
    Dim Sh As Worksheet
    Application.DisplayAlerts = False
    For Each Sh In Worksheets
    If Sh.Name <> ActiveSheet.Name Then Sh.Delete
    Next Sh
    Application.DisplayAlerts = True
    End Sub

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com