+ Reply to Thread
Results 1 to 5 of 5

Hide or Unhide worksheets in a workbook using check boxes

  1. #1
    Registered User
    Join Date
    12-13-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Hide or Unhide worksheets in a workbook using check boxes

    Hello all! I really need some help on this. I am trying to create a excel information sheet using checkboxes to hide / unhide worksheets within my workbook. Lets say I have a building containing 297 rooms, I have a check box for every room. When a room is checked (True) the corrisponding worksheet will unhide and open up for review. It would also be nice if there was a save button or an option to save upon closingExample Rooms List.xlsm the worksheet. I have attached a sample of what I have been working on. I can't seem to get the code to work though. Please help!

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Hide or Unhide worksheets in a workbook using check boxes

    Maybe use the checkbox from the controls toolbar, then you could sate
    Please Login or Register  to view this content.
    I don't want to get into the example you provided because you have 8 Check boxes with the same name.
    Last edited by davesexcel; 12-13-2012 at 11:27 PM.

  3. #3
    Registered User
    Join Date
    12-13-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Hide or Unhide worksheets in a workbook using check boxes

    Thanks for the info Davesexcel... I will give that a shot. I was unaware that I had named all the check boxes the same... I meant to name them as follows: Room 101, Room 102, Room 103, Room 104.... so on and so forth for a total of 297. Each of which, when checked, would open it's own data sheet. Please let me know if this info helps in any way. Thanks Again!

  4. #4
    Registered User
    Join Date
    12-13-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Hide or Unhide worksheets in a workbook using check boxes

    I have tried the VBA that you suggested. I don't know if I am putting it in the right place or even if I am inputting the correct information into the VBA... Here is what I have done.
    In Sheet 1 I have entered the following VBA:

    Please Login or Register  to view this content.
    I saved it as an .XLSM and closed the file. I reopened it and enabled macros and nothing happens. I have also hidden the 3 corresponding worksheets prior to saving as an XLSM. I apologize in advance for my noviceness!
    Last edited by vlady; 12-14-2012 at 01:00 AM. Reason: put code tags on you codes

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Hide or Unhide worksheets in a workbook using check boxes

    Your checkboxes are from the forms tool bar, and the code belongs in a regular module, you have the code in a worksheet module of a hidden sheet.
    Right click on the checkbox and select assign macro,=>New
    Something like,
    Please Login or Register  to view this content.

+ 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