+ Reply to Thread
Results 1 to 5 of 5

How to unhide/hide sheets with Macro?

  1. #1
    Valued Forum Contributor
    Join Date
    12-22-2010
    Location
    Texas
    MS-Off Ver
    Excel 2003 & Excel/Access 2007
    Posts
    438

    How to unhide/hide sheets with Macro?

    I have this code:

    HTML Code: 
    Keep getting error messages... Basically if the "1" is chosen from the drop down box I would like to open "Sheet1" and so on and so forth...
    Last edited by jgomez; 02-04-2013 at 11:22 AM.

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: How to unhide/hide sheets with Macro?

    try this
    Please Login or Register  to view this content.
    Last edited by john55; 02-04-2013 at 12:05 AM.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,440

    Re: How to unhide/hide sheets with Macro?

    As far as I recall, you must have at least one sheet visible. So, you need to ensure that you make the sheet you want to see visible before you make the others hidden. Use ScreenUpdating=False to hide the transition (a little)

    You might need to re-sequence John’s code or it might fail.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: How to unhide/hide sheets with Macro?

    TMS, yes, you're right, he needs to have at least one sheet visible, maybe that sheet where the combobox is, then he can hide/unhide therest of his sheets!

  5. #5
    Valued Forum Contributor
    Join Date
    12-22-2010
    Location
    Texas
    MS-Off Ver
    Excel 2003 & Excel/Access 2007
    Posts
    438

    Re: How to unhide/hide sheets with Macro?

    Thank you both, yes the combobox was a seperate sheet from one and two.

+ 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