+ Reply to Thread
Results 1 to 8 of 8

Button that has a macro that will open a hidden worksheet

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    Washington DC
    MS-Off Ver
    Excel 2003
    Posts
    9

    Button that has a macro that will open a hidden worksheet

    Hello everyone,

    I need some help. I have a workbook that has 28 tabs. The first 2 tabs I have added buttons that will take me to the worksheet needed, they are just countries eith different information listed on each worksheet, there isnt any formulats or numbers, just basic information. I want to hide all the worksheets, except the first 2 that have the buttons, when a button is selected i want that worksheet to open only, and then close when I got back to the main tab.

    Thanks in advance!!

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Button that has a macro that will open a hidden worksheet

    like this? : xlWs.xlsm
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Registered User
    Join Date
    05-08-2013
    Location
    Washington DC
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Button that has a macro that will open a hidden worksheet

    Exactly!! How do i do that?

  4. #4
    Registered User
    Join Date
    05-08-2013
    Location
    Washington DC
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Button that has a macro that will open a hidden worksheet

    I am sorry I am very new and very unexperienced, can you please tell me step by step how to do this?

  5. #5
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Button that has a macro that will open a hidden worksheet

    1. When the Sheets "Overview" or "General" are activated, means you change from another sheet to one of these the "Worksheet_Activate" event is triggered. The following code in located in the worksheet module of "General" and "Overview" sheet.
    Please Login or Register  to view this content.
    It will call the sub "AllSheetsVisible" with parameter "2"

    2. The sub "AllSheetsVisible" is setting the visibility of all sheets to "2" but skipping "General" and "Overview":
    Please Login or Register  to view this content.
    3. Now to make a sheet visible select a sheet from the combobox and press the button, when the button is pressed the "Private Sub BUTTONNAME_Click()" event is triggered. It will call "AllSheetsVisible" again to hide all previously opened sheets and unhides and activates the sheet from the combobox.
    Please Login or Register  to view this content.
    4. Now you might wonder how the combobox is filled with the sheetnames, this happens each time the workbook is opened, so if you add sheets, reopen the file. The filling takes place in the "ThisWorkbook" module with:
    Please Login or Register  to view this content.
    5. If the worksheet names "Overview" or "General" changes you have to change this in the code as they are skipped in each operation.

  6. #6
    Registered User
    Join Date
    05-08-2013
    Location
    Washington DC
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Button that has a macro that will open a hidden worksheet

    I am sorry, I cant get it to work, I have attached my file for help if you can.

    Thank you so much!!

  7. #7
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Button that has a macro that will open a hidden worksheet


  8. #8
    Registered User
    Join Date
    05-08-2013
    Location
    Washington DC
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Button that has a macro that will open a hidden worksheet

    You are the BEST Thank you so much!!

+ 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