+ Reply to Thread
Results 1 to 4 of 4

Macro that runs when a sheetname in a file does not exist

  1. #1
    Registered User
    Join Date
    02-14-2017
    Location
    Hilversum, Netherlands
    MS-Off Ver
    2010
    Posts
    92

    Macro that runs when a sheetname in a file does not exist

    Hi Guys!

    I am looking for a solution to a problem i'm facing in the code below I want to import data from a file if the file name contains "Test". If the filename contains "Test" VBA should unprotect the sheets and look for a sheet called "Check test".

    This is where the problem starts. Not every file called "Test" has a sheet called check test. I would like the macro to move on to the next workbook (and preferably give a message) if this sheet does not exist in the file. Please help out!!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro that runs when a sheetname in a file does not exist

    You have already a test done to check if the worksheet exit
    Please Login or Register  to view this content.
    What do you need more ???
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    02-14-2017
    Location
    Hilversum, Netherlands
    MS-Off Ver
    2010
    Posts
    92
    Quote Originally Posted by PCI View Post
    You have already a test done to check if the worksheet exit
    Please Login or Register  to view this content.
    What do you need more ???
    This doesn’t seem to work for Some reason...

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro that runs when a sheetname in a file does not exist

    Where the function WorksheetExists2("Check sheet") is ???
    Else another one

    Please Login or Register  to view this content.

+ 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] if file exist macro problem
    By etuzgen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-18-2014, 06:41 AM
  2. [SOLVED] Save as macro; File allready exist
    By tigergutt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2013, 09:15 AM
  3. Have macro over write existing file from control button if file exist
    By pjbassdc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-30-2011, 10:35 AM
  4. When open File A, runs macro in File B
    By Wizz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-28-2007, 06:27 AM
  5. Replies: 3
    Last Post: 05-15-2006, 05:00 AM
  6. Replies: 3
    Last Post: 03-11-2006, 02:50 PM
  7. Replies: 0
    Last Post: 03-10-2006, 05:55 AM

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