+ Reply to Thread
Results 1 to 8 of 8

Select Multiple Sheets Based on Cell Values VBA

  1. #1
    Registered User
    Join Date
    11-01-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    7

    Select Multiple Sheets Based on Cell Values VBA

    Hello All,

    I am new to Excel Forum and a relative novice to VBA. I appreciate any and all help!

    I suspect this is easy, but what I am looking for is a code that will select multiple sheets if its corresponding value in a separate sheet is yes.

    For example, in Sheet 4 I have a list starting in A1 going down that says Sheet 1, Sheet 2, Sheet 3. Starting in B1 going down the Values are "Yes", "No", "Yes". Therefore based on those values I would like Sheet 1 and Sheet 3 selected.

    Thanks in advance!

    Zach

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Select Multiple Sheets Based on Cell Values VBA

    Is every Sheet in your workbook included on the list? Are any sheets on your list more than once? Are they on you list in sequencial order?

    Maybe:
    Please Login or Register  to view this content.
    Last edited by Solus Rankin; 11-12-2013 at 03:45 PM.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    11-01-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Select Multiple Sheets Based on Cell Values VBA

    Seems to work great! Thanks a lot. Really appreciate it!

  4. #4
    Registered User
    Join Date
    11-01-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Select Multiple Sheets Based on Cell Values VBA

    Ok I apologize. There is one small issue. It selects the tab where the calculations are taking place. This is the "Calc" sheet in my workbook. This should never be selected. I tried adding that to the list of sheets the VBA code works through, but to no avail.

    Any thoughts?

    Thanks, sorry again.

    Zach

  5. #5
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Select Multiple Sheets Based on Cell Values VBA

    If its not on the list it should never be selected. Is it selected when the macro runs?

  6. #6
    Registered User
    Join Date
    11-01-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Select Multiple Sheets Based on Cell Values VBA

    I actually just moved it to a sheet that will always be selected and that solved the problem. Any idea why it selects cells C4 to N4 once complete? Not a big deal, just curious.

    Thanks again!

  7. #7
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Select Multiple Sheets Based on Cell Values VBA

    No clue. Sounds to me like they were selected to begin with. No ranges are selected during the code above.

  8. #8
    Registered User
    Join Date
    01-16-2014
    Location
    Southern California
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Select Multiple Sheets Based on Cell Values VBA

    I'm trying to use the code above, but I cannot get it to work, I don't have my list at a1, b1, I have my list in middle of sheet, so I put in C27:C38 for the Name of the sheets and D27:D38 is whether is yes or no. I cannot get any errors either? Help?? I've looked at several codes like this, but this one was simplified where I felt I could edit, the others I could get to run either. I must be doing something wrong????

+ 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. Replies: 8
    Last Post: 06-24-2014, 03:35 PM
  2. Select Multiple Sheets based on List
    By roasty_1 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-22-2014, 01:36 AM
  3. Replies: 1
    Last Post: 10-01-2013, 02:41 AM
  4. How to select rows based on data in a column off multiple sheets?
    By wdwinterfang in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-20-2013, 11:51 PM
  5. [SOLVED] Want to pull values based on same cell # but from multiple sheets
    By pamc in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-29-2013, 09:52 AM

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