Results 1 to 7 of 7

Delete Worksheets That Contain..

Threaded View

sjennings007 Delete Worksheets That... 02-26-2014, 12:23 PM
rcm Re: Delete Worksheets That... 02-26-2014, 12:26 PM
sjennings007 Re: Delete Worksheets That... 02-26-2014, 12:31 PM
shg Re: Delete Worksheets That... 02-26-2014, 12:27 PM
sjennings007 Re: Delete Worksheets That... 02-26-2014, 12:30 PM
shg Re: Delete Worksheets That... 02-26-2014, 12:35 PM
sjennings007 Re: Delete Worksheets That... 02-26-2014, 12:37 PM
  1. #1
    Registered User
    Join Date
    08-21-2013
    Location
    United States
    MS-Off Ver
    2010
    Posts
    41

    Delete Worksheets That Contain..

    I have a workbook that contains over 100 sheets, all built from templates. Some of them contain data and some do not. i'd like to delete all of the ones that do not contain data. I found and modified this code from another post.
    Sub delete()
    Application.DisplayAlerts = False
    Dim ws As Worksheet
    For Each ws In ThisWorkbook.Sheets
    If IsEmpty(Range("C9")) Then ws.delete
    Next ws
    Application.DisplayAlerts = True
    
    End Sub
    This code does not work but it at least shows what i'm trying to do.
    Last edited by sjennings007; 02-26-2014 at 12:45 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 11-30-2013, 06:37 AM
  2. Delete all worksheets except the first one
    By Nithya1987 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-05-2011, 03:02 AM
  3. Do while loop to delete worksheets if worksheets are not in the specified list
    By kchm_2000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-26-2011, 03:02 PM
  4. Do While Loop to Delete Worksheets
    By kchm_2000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2011, 01:34 PM
  5. I can't delete my worksheets
    By chuckmcc in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-17-2006, 06:15 PM

Tags for this Thread

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