delete all sheets except active sheet

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: delete all sheets except active sheet

  1. #1
    Board Regular
    Join Date
    Jun 2002
    Posts
    102
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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,129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

User Tag List

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