+ Reply to Thread
Results 1 to 2 of 2

How do I check to see if a worksheet is in a different workbook?

  1. #1
    Registered User
    Join Date
    02-24-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2007
    Posts
    15

    How do I check to see if a worksheet is in a different workbook?

    I have a master workbook that opens up many others. There are two flavors of target workbooks and I would like to auto determine which is which. I am hoping this can be done because each have unique spreadsheets within them. Is there an easy way to querry the workbook and if the sheet is there return "true"?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: How do I check to see if a worksheet is in a different workbook?

    Hello Doctor Dinero,

    Here is an example. Due to the lack of details in your post, I can not offer you a specific solution.

    This macro will check all open workbooks, except for the workbook the macro is in. Each sheet in every workbook is compared to two possible names: Sales Orders, Purchase Orders. You can change these to match the worksheets you will be checking for.

    If a match is made then the Function will return either "Sales" or "Purchases" as the workbook type. Again, you can change this to what you will be using.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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