+ Reply to Thread
Results 1 to 2 of 2

Delete a sheet, if it exists

  1. #1
    Registered User
    Join Date
    06-26-2011
    Location
    Atlanta, GA
    MS-Off Ver
    MS365, vsn 16.0.17909.42302
    Posts
    45

    Delete a sheet, if it exists

    I've seen examples here where you can use "dim" and a subroutine, but isn't there a simpler way? Isn't there something like:

    if exists("sheetname") then
    delete "sheetname"

    Is there no function specific to this?

  2. #2
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Delete a sheet, if it exists

    There isn't a specific function to check if a sheet exists, but it is easy to write your own. For example:
    Please Login or Register  to view this content.
    Although, since the end result either way is that you want a workbook without the sheet, I'm not totally convinced checking to see if it exists first is entirely necessary.
    Last edited by Colin Legg; 11-13-2011 at 09:09 PM.
    Hope that helps,

    Colin

    RAD Excel Blog

+ 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