+ Reply to Thread
Results 1 to 3 of 3

Hide and Unhide Sheets using Checkboxes

  1. #1
    Registered User
    Join Date
    01-15-2014
    Location
    CT
    MS-Off Ver
    Excel 2007
    Posts
    8

    Hide and Unhide Sheets using Checkboxes

    Hello -

    Using Excel 2007, I have a workbook with 7 sheets. The first one is a Navigation Page where I have checkboxes (form controls, not active X) with the names of the other 6 sheets. When the box(es) are checked, the sheet(s) become visible. I have accomplished this by assigning macros I recorded.

    I need to now add the opposite: When the box(es) are unchecked, the sheets become hidden. From googling and looking for other threads/forums here, I gather that I need to add code/ VBA, but I know nothing about these at all.

    Can someone help? Feel free to dumb it down as much as possible. I can upload a copy of my sheet if that helps. Thank you very much in advance.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Hide and Unhide Sheets using Checkboxes

    Create a new VBA general module for your workbook.
    • Select your workbook
    • ALT+F11...to open the VBA editor
    • Insert.Module...to create a general module

    Copy the below code and paste it into that module:
    Please Login or Register  to view this content.
    • Set the caption of each checkbox to be the name of the sheet to be displayed/hidden
    • Assign the ShowHideSheet macro to each checkbox

    Now, when a checkbox is clicked...
    VBA will note the caption and
    - if the checkbox is checked...the sheet will be made visible
    - if the checkbox is unchecked...the sheet will be hidden

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    01-15-2014
    Location
    CT
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Hide and Unhide Sheets using Checkboxes

    That works perfectly. Thank you very much for your help!!

+ 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. [SOLVED] Hide/unhide rows with checkboxes
    By mixer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-05-2014, 03:58 PM
  2. need macro to hide/unhide columns through multiple checkboxes
    By trier in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2013, 04:00 PM
  3. Using multiple checkboxes as an index page to hide/unhide worksheets
    By Damien_Lee in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-11-2013, 07:24 AM
  4. Using checkboxes on summary sheet to name tabs and hide/unhide tabs
    By eew2201 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2012, 06:13 PM
  5. Hide/Unhide Multiple Checkboxes
    By LampCommandr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2011, 09:35 AM

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