+ Reply to Thread
Results 1 to 2 of 2

Remove unwanted tabs

  1. #1
    Registered User
    Join Date
    05-07-2005
    Posts
    9

    Remove unwanted tabs

    Can someone please provide me with a procedure to delete unused tabs.

    I have a workbook that has 20 tabs containing pricing and material numbers. When the users fills out information it is usually only on one tab and I would like a macro function to automatically delete the other 19 sheets to reduce the size of the file.

    Thanks,

    GG

  2. #2
    JMB
    Guest

    RE: Remove unwanted tabs

    I think this will do what you need. Back up your workbook before trying it
    out.

    Sub DeleteTabs()
    On Error Resume Next
    Application.DisplayAlerts = False

    For Each x In Worksheets
    If IsEmpty(x.UsedRange) Then x.Delete
    Next x

    Application.DisplayAlerts = True

    End Sub

    "greengrass" wrote:

    >
    > Can someone please provide me with a procedure to delete unused tabs.
    >
    > I have a workbook that has 20 tabs containing pricing and material
    > numbers. When the users fills out information it is usually only on
    > one tab and I would like a macro function to automatically delete the
    > other 19 sheets to reduce the size of the file.
    >
    > Thanks,
    >
    > GG
    >
    >
    > --
    > greengrass
    > ------------------------------------------------------------------------
    > greengrass's Profile: http://www.excelforum.com/member.php...o&userid=23119
    > View this thread: http://www.excelforum.com/showthread...hreadid=374981
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1