+ Reply to Thread
Results 1 to 4 of 4

How to find if sheet exist in workbook

  1. #1
    Registered User
    Join Date
    12-25-2010
    Location
    Rotterdam
    MS-Off Ver
    Excel 2010
    Posts
    18

    How to find if sheet exist in workbook

    i am trying the code below, but it is missing something??


    SheetExist = 1
    Set ws = Sheets(var1& var2) ( this is whats not picking up )
    If ws Is Nothing Then SheetExist = 0
    Sheets(var1 & var2).Select ' juiste tabblad selecteren

  2. #2
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: How to find if sheet exist in workbook

    hi,

    try below function for check if sheet exists
    Please Login or Register  to view this content.
    for test it:
    Please Login or Register  to view this content.
    Last edited by MaczaQ; 02-07-2013 at 07:09 AM.
    Best Regards
    MaczaQ
    ---------------------------------------------------------------------------------------------------------------------------
    If you are satisfied with the solution(s) provided, please mark your thread as Solved
    If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
    - This way you will add him some reputation points ... thanks in advance.

  3. #3
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: How to find if sheet exist in workbook

    Try

    Please Login or Register  to view this content.
    If you like my contribution click the star icon!

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to find if sheet exist in workbook

    Or

    Please Login or Register  to view this content.
    Last edited by :) Sixthsense :); 02-07-2013 at 07:24 AM.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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