+ Reply to Thread
Results 1 to 5 of 5

Selecting a sheet from a range - issue with hidden sheets.

  1. #1
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Selecting a sheet from a range - issue with hidden sheets.

    Hi,

    I have the below code that selects the sheet from a dropdown list box as selected by the user. How can I modify it so that it unhides hidden sheets first - as at present im just getting an error if the selected sheet is hidden.


    Please Login or Register  to view this content.
    Last edited by Barking_Mad; 05-09-2013 at 10:40 AM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,028

    Re: Selecting a sheet from a range - issue with hidden sheets.

    Try;
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Re: Selecting a sheet from a range - issue with hidden sheets.

    Thanks. What difference to the code does Intersect make?

  4. #4
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Selecting a sheet from a range - issue with hidden sheets.

    Intersect doesn't really make a difference to your code, but it's easier to use if you want to check a range of cells rather than one cell in particular.
    When working with worksheet_change macros, it's better to get used to applying intersect, even if it's just one cell you're checking.
    That's all

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,028

    Re: Selecting a sheet from a range - issue with hidden sheets.

    Just to add to what JasperD has stated ... When using a Worksheet_Change event, 'Target' refers to the active cell. The use on 'Intersect' restricts the 'Target' to the range, in this case E10. What this means is that if you select any other cell outside of the described range, the macro will terminate. The 'Target' in your case will always be the value of E10. I hope this helps.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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