+ Reply to Thread
Results 1 to 15 of 15

Select Multiple Sheets based on List

  1. #1
    Registered User
    Join Date
    07-30-2007
    Posts
    61

    Question Select Multiple Sheets based on List

    Hi All

    File attached to show problem

    How do I select all the sheets that are Marked Y in column B when the button is clicked?

    Thanks

    Roasty
    Attached Files Attached Files
    Last edited by roasty_1; 10-24-2008 at 09:13 AM.

  2. #2
    Forum Contributor Stuie's Avatar
    Join Date
    09-17-2006
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003/2007
    Posts
    432
    Hi roasty_1,

    I have attached a workbook and i have coded the button to check each one and then add that worksheet to a array of worksheets.

    to access the worksheet you can use this code

    Please Login or Register  to view this content.
    change the 1 to the index you need and the Select the method you want to call.

    anything else let me know
    Attached Files Attached Files
    There are only 10 types of people in the world:
    Those who understand binary, and those who don't!

  3. #3
    Registered User
    Join Date
    07-30-2007
    Posts
    61
    thanks

    sorry but the button does not do anything.....

    no sheets are selected when the code has run?

    thanks

  4. #4
    Forum Contributor Stuie's Avatar
    Join Date
    09-17-2006
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003/2007
    Posts
    432
    oh right sorry i have loaded them into a array so you can access them sheets, sorry i didnt realise that you wanted them selected. i will have a look to see if i can work that one out

  5. #5
    Registered User
    Join Date
    07-30-2007
    Posts
    61
    ok
    cheers

  6. #6
    Forum Contributor Stuie's Avatar
    Join Date
    09-17-2006
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003/2007
    Posts
    432
    sorry roasty_1, i cant seem to get it to work no matter what i try.

    does anybody else know how to do this as i am now interested.

  7. #7
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    Try attached file.

    Regards,
    Antonio
    Attached Files Attached Files

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431
    There are a couple of ways of selecting the sheets.
    Either using the Replace argument or by building an array of sheetnames.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  9. #9
    Registered User
    Join Date
    07-30-2007
    Posts
    61
    Thanks Antonio

    Works well, only it crashes Excel if any of the cells are left blank, not an issue though, can work round that.

    thanks for your help.

  10. #10
    Registered User
    Join Date
    07-30-2007
    Posts
    61
    Hi Andy

    thanks for your help, couldnt get your code to work unfortunetly, thanks anyway.

  11. #11
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431
    In what way did it not work?

    raised an error
    No selection of sheets

  12. #12
    Registered User
    Join Date
    07-30-2007
    Posts
    61
    weird, it works now, before I was getting an Object error

    Now works fine

    Thanks!!

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

    Re: Select Multiple Sheets based on List

    I'm confused where is the macro, VBA for the select sheets, its that the one for the sheet downloaded above?

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

    Re: Select Multiple Sheets based on List

    I cannot get this to work, errored out on last line of code, Sheets(mySheets).Select?

  15. #15
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Select Multiple Sheets based on List

    miztify,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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