+ Reply to Thread
Results 1 to 3 of 3

Macro to show worksheets based on a a hidden sheet, that lists the sheets that should show

  1. #1
    Registered User
    Join Date
    08-14-2014
    Location
    delhi, india
    MS-Off Ver
    2013
    Posts
    4

    Macro to show worksheets based on a a hidden sheet, that lists the sheets that should show

    Hi, I have four buttons in my excel that show sheets using macro. The button works in the below way:

    D1 - Shows Sheet1, Sheet 3, Sheet 7
    D2 - Shows Sheet2, Sheet 4, Sheet 6
    D3 - Shows Sheet5, Sheet 8,
    D4 - Shows Sheet D9


    For now we have hard-coded the values in the code about which sheets will open. Now we need to automate this so that there is an excel sheet A in the same file.
    This sheet A will have list of button names and sheets to view. Our code should be taking the list of tabs from this sheet.
    coding should be like which allow us to maintain this if we decide changes in grouping are needed.


    D1-----------D2-----------------D3------------------D4
    Sheet 1 -----Sheet 2----------- Sheet 5------------- Sheet9
    Sheet 3 -----Sheet 4------------Sheet 8
    Sheet 7------ Sheet 6

    Any help would be appreciated.


    Thanks
    Preeti Jha

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Macro to show worksheets based on a a hidden sheet, that lists the sheets that should

    a sample file with data an desired output would be appreciated.
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor codeslizer's Avatar
    Join Date
    05-28-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003 - 2010
    Posts
    245

    Lightbulb Re: Macro to show worksheets based on a a hidden sheet, that lists the sheets that should

    Basically the concept you can try is hide all sheets first then iterate through DESIRED column range for which you want to provide the visibility.. for instance refer the attached file.

    In the attached file, I have used just one button to perform two operations:

    1. To get the desired column range, using a function "GetColumn"
    2. To hide all sheets and then iterate and show only listed sheet names

    Check and let me know if this is what you have been looking for.

    Code is as follows under Module1:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    cOdEsLiZeR - Back after a long break.. Let's sLiZe some more cOdEs!!

+ 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. VBA Macro to show/hide hidden worksheets using drop down list
    By Tillybee in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-18-2017, 12:28 PM
  2. Can't Show Hidden Sheets
    By sayed in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2011, 04:09 AM
  3. Macro to show the copy of a hidden sheet
    By gaftalik in forum Excel General
    Replies: 2
    Last Post: 01-18-2011, 09:03 AM
  4. Create a macro to show a hidden sheet.
    By yanikeke in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-19-2010, 07:23 PM
  5. Create macro to show hidden sheet
    By ncaravela in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-30-2010, 11:50 AM

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