Forum

question on creatin...
 
Notifications
Clear all

question on creating a menu tab

4 Posts
2 Users
0 Reactions
111 Views
(@pyclen)
Posts: 11
Eminent Member
Topic starter
 

I found a solution to hide tabs that I don't need to show, the downside is all other tabs get hidden however I want a summary tab to show AND the tab (or tabs) selected. A sample file that has the macro to show the selected tab is attached plus a screenshot below.

Not sure if this is possible but this solution (whether it is a macro, an addin (can they be attached to the file and always be present??)) needs to work for others as well, i.e., there can't be custom addins etc. be needed, all has to be w/in this file.

I have to say I have no clue about VBA therefore I may not completely know how to do things, i.e., I would appreciate detailed guidance if possible.

Thank you

 

1642454888601.png

 
Posted : 18/01/2022 5:43 pm
(@debaser)
Posts: 837
Member Moderator
 

Change the ShowSelSheets code in Module1 to:

 

Sub ShowSelSheets()
   Dim ws As Worksheet
   Dim strType As String
   strType = Worksheets("Menu").Range("SelectType").Value
   For Each ws In ActiveWorkbook.Sheets
      If InStr(1, ws.Name, strType) > 0 Then
         ws.Visible = xlSheetVisible
      Else
         Select Case LCase$(ws.Name)
            Case "menu", "summary"
               ws.Visible = xlSheetVisible
            Case Else
               ws.Visible = xlSheetHidden
         End Select
      End If
   Next ws
End Sub

 
Posted : 19/01/2022 4:54 am
(@pyclen)
Posts: 11
Eminent Member
Topic starter
 

Thank you, that indeed does the trick. I now have 3 sheets visible (Menu, Summary, Testing 1/2/3/4).

Is it possible to expand that to other tabs so one could see let's say 4 or more tabs at once (like Menu/Summary, Testing 1, Testing 2).

In other words can there be a selection (maybe via multiple dropdown lists w/the same content) for showing several tabs at once depending upon user choice/needs?

 
Posted : 19/01/2022 8:53 am
(@debaser)
Posts: 837
Member Moderator
 

Yes, that's possible (most things are!) though I would probably use a listbox rather than multiple comboboxes. I suspect that should be posted as a different question, though I'm not 100% sure of the etiquette here for that sort of thing.

 
Posted : 19/01/2022 10:18 am
Share: