+ Reply to Thread
Results 1 to 6 of 6

Checkbox on Sheet 1 to Unhide Sheet 2

  1. #1
    Registered User
    Join Date
    05-07-2017
    Location
    Texas, United States
    MS-Off Ver
    Microsoft Office 365
    Posts
    4

    Checkbox on Sheet 1 to Unhide Sheet 2

    I have a workbook containing 5 sheets. Sheet 1 is titled "Checklist" which contains 11 check boxes with statements. These statements are requirements that the user must agree to before being allowed to move on to sheets 2-5.


    The statements are similar to:
    - Do you have a driver's license?
    - Are you 18 years or older?
    - Can you lift up to 30 lbs?
    - etc etc


    My question is:


    Is it possible to apply a code to Sheet 1 to have it as the only visible sheet upon opening the file and as soon as all 11 check boxes have been checked, sheets 2-5 then become visible


    Thank you in advance


    Jeff

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Checkbox on Sheet 1 to Unhide Sheet 2

    Assuming Office 365 has VBA capability,
    place this macro in ThisWorkbook section of VBA
    Please Login or Register  to view this content.
    It will hide all the sheets but Sheet1.
    Then, put the following macro in it your Sheet1 section.
    Please Login or Register  to view this content.
    Each CheckBox can have a similar macro. The macro I supplied is showing you how to hide or not a sheet.
    What I would do is to create a module and create a new macro that you will call from each of your CheckBox macros.
    That new macro will then check all the CheckBox to hide or not your sheets.

    If you need more detailed help, do not hesitate to ask.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    05-07-2017
    Location
    Texas, United States
    MS-Off Ver
    Microsoft Office 365
    Posts
    4

    Re: Checkbox on Sheet 1 to Unhide Sheet 2

    WHOA, p24leclerc !!

    This is amazing!! Let me stick this in, play with it for a while and I'll get back to you with questions or comments

  4. #4
    Registered User
    Join Date
    05-07-2017
    Location
    Texas, United States
    MS-Off Ver
    Microsoft Office 365
    Posts
    4

    Re: Checkbox on Sheet 1 to Unhide Sheet 2

    p24leclerc.. Good day!

    So I've tried and tried and have not had any success. I am beginner with minimal training.. maybe 5 hours of play-time with VBA and macros.. so please excuse my ignorance

    On that note, this is where I currently stand.

    I started fresh with a new workbook including 2 sheets
    - Sheet1
    - Sheet2
    On Sheet 1 I created a checkbox. Question: Should this be Form or ActiveX?
    Using a Form Control, I have followed your directions with the code you provided.
    Step 1: insert 1st macro into workbook
    This did exactly as you said it would. Upon running the sub (F5), Sheet 2 is automatically hidden
    Step 2: insert 2nd macro into sheet 1 (i made one edit, changing CheckBox2 --> CheckBox1)
    This automatically creates Module 1
    Step 3: run sub and create macro name (gave it the name: checkbox1)
    Step 3: back in the worksheet, Assign macro to CheckBox1 with >right click on CheckBox1 >assign macro >select the macro titled: checkbox1 >OK

    At this point I feel like this is where you say the check box should be "Alive" yet nothing is happening for me..

    Thank you for your time and any input provided on this subject matter

    Jeff

  5. #5
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Checkbox on Sheet 1 to Unhide Sheet 2

    here is how you could do this:
    You create as many CheckBox (ActiveX one) as you need.
    For each of them, while in the design mode, you right click on it and select view code. This will create a CheckBox1_click() macro
    Do this for every checkbox you created.
    Here is an example of how it looks with 3 checkboxes:
    Please Login or Register  to view this content.
    You see that each CLICK macro calls the Hide_Tab one which is the one that makes decision.
    The only thing you put in each of your CLICK macro is "Call Hide_Tab"

    See attached workbook for a workbing sample.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-07-2017
    Location
    Texas, United States
    MS-Off Ver
    Microsoft Office 365
    Posts
    4

    Re: Checkbox on Sheet 1 to Unhide Sheet 2

    Yesssss!!! This is exactly what I have been searching for.

    I applied this to my worksheet and added a private sub for check boxes all the way down to CheckBox11.
    From there I added the sheets I needed under the if statement and "titled" them with proper names.
    F5 keystroke and magic...

    Thank you for you input and time to construct this solution!

    Jeff Ewing

+ 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. Replies: 6
    Last Post: 01-30-2017, 03:07 PM
  2. Hide or Unhide Rows on one sheet based on value entered in cell on another sheet
    By wfsteadman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2016, 07:30 PM
  3. [SOLVED] Toggle Button to Unlock Sheet with Set Password and Unhide Rows and Relock Sheet
    By nwb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-20-2014, 06:16 PM
  4. Checkbox macros hide and unhide on another sheet
    By jasonexcels in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2012, 11:13 AM
  5. Hide/Unhide rows with a checkbox on a different sheet
    By blah54 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-15-2012, 11:26 AM
  6. Replies: 3
    Last Post: 11-12-2010, 04:31 AM
  7. unhide sheet, copy data, hide sheet - screenupdate = false
    By titus.hanke in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-08-2008, 02:46 PM

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