+ Reply to Thread
Results 1 to 4 of 4

Deleting Multiple Worksheets Except Named Worksheets

  1. #1
    Forum Contributor
    Join Date
    02-18-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    197

    Deleting Multiple Worksheets Except Named Worksheets

    I use the following code to delete new sheets and only keep the original when the workbook is saved. I'd like to apply the same idea to a workbook with multiple worksheets, but I can't get the syntax right. How would I delete worksheets not named Sheet1, Sheet2, etc?


    Please Login or Register  to view this content.

    [i]Thanks!![/]

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Deleting Multiple Worksheets Except Named Worksheets

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,372

    Re: Deleting Multiple Worksheets Except Named Worksheets

    Hi philbin,

    I'd do this problem using the following code in a Module.

    Please Login or Register  to view this content.
    I'd call the code from:
    Please Login or Register  to view this content.
    See the attached example.
    OnClose Delete Sheets.xlsm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Contributor
    Join Date
    02-18-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    197

    Re: Deleting Multiple Worksheets Except Named Worksheets

    Yup! Works perfectly. Thanks so much!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Deleting Multiple Worksheets with VBA
    By phelbin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-29-2016, 07:06 PM
  2. Copy selected worksheets between workbooks onto named worksheets
    By AndrewSimpson87 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-24-2014, 03:25 PM
  3. Deleting Multiple worksheets except.
    By Nithya1987 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-22-2011, 09:22 PM
  4. Deleting a rows from multiple worksheets
    By School Teacher in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 AM
  5. [SOLVED] Deleting a rows from multiple worksheets
    By School Teacher in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-06-2005, 02:05 PM

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