+ Reply to Thread
Results 1 to 3 of 3

IF Sheet Exists not working as expected

  1. #1
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    IF Sheet Exists not working as expected

    I have list of worksheets in a cell that I am putting into an array and then looping to see if the worksheets exists. And if the worksheet is missing to exit the sub.

    I can debug.print the array values and see the correct names. But I can't seem to get the IfSheetExists to correctly abort on missing worksheet.

    Probably something obvious, but just missing it in my need coffee wakeup morning.

    This is the section(s) of code I am currently working with extracted from the larger code.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: IF Sheet Exists not working as expected

    Remove quotes?
    Please Login or Register  to view this content.
    This is what I use:
    Please Login or Register  to view this content.
    Last edited by Kenneth Hobson; 12-29-2018 at 11:53 AM.

  3. #3
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: IF Sheet Exists not working as expected

    Thanks,

    I just figured it out. When I was first trying and removing the quotes, it kept throwing an error.

    I just realized after trying your Function and getting the same error that the function is looking for a String, and I needed to change that to a Variant in order to pass the Array value into it.

    Seems to working correctly now.

+ 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. [SOLVED] Button visible on 'last sheet only' not working as expected
    By kjg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-15-2017, 05:11 PM
  2. Sheet Exists Not Working?
    By ptmuldoon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2017, 04:01 PM
  3. [SOLVED] my add button not working as expected, i have included the workbook, see navigation sheet
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-18-2016, 04:04 PM
  4. [SOLVED] CountIfS not working as expected
    By rschoenb in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-12-2014, 11:45 PM
  5. ISNA not working as expected
    By micco in forum Excel General
    Replies: 2
    Last Post: 06-30-2011, 01:54 PM
  6. Cell/sheet protection not working as expected
    By LAF in forum Excel General
    Replies: 3
    Last Post: 09-24-2010, 01:04 AM
  7. Cell/sheet protection not working as expected
    By LAF in forum Excel General
    Replies: 1
    Last Post: 06-08-2010, 01:09 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