+ Reply to Thread
Results 1 to 3 of 3

VBA - How can I test if a certain sheet already exists?

  1. #1
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    VBA - How can I test if a certain sheet already exists?

    I have a macro to create new sheets with various names in the workbook. How can I check whether a worksheet name already exists? A simple function like Function DoesSheetExist(worksheetName) as boolean would be useful to me. Any & all help is appreciated.

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

    Re: VBA - How can I test if a certain sheet already exists?

    This one line If-Evaluate method is one I use.

    Please Login or Register  to view this content.
    If you want a function, try something like this...
    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 10-15-2014 at 11:42 AM.
    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
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    Re: VBA - How can I test if a certain sheet already exists?

    Many Thanks. Just what I was hoping for.

    -Stu

+ 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. Test if subtotal exists
    By jmicdk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-03-2016, 12:51 PM
  2. Excel 2007 : test if picture exists on sheet
    By JimBobBowie in forum Excel General
    Replies: 2
    Last Post: 12-28-2014, 08:25 PM
  3. Test If List Exists
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-16-2009, 08:03 PM
  4. Test if sheet exists
    By hutch@edge.net in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-12-2009, 12:12 PM
  5. [SOLVED] How to test if a DLL (library) exists
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2005, 04:05 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