+ Reply to Thread
Results 1 to 7 of 7

Show Specific Sheets in Excel With Drop Down List

  1. #1
    Registered User
    Join Date
    08-23-2014
    Location
    Miami, USA
    MS-Off Ver
    365
    Posts
    69

    Exclamation Show Specific Sheets in Excel With Drop Down List

    Good day!!

    I'm having trouble trying to open a specific worksheet that is selected from a dropdown list. The goal is to select one of the 32 options from the dropdown list and have excel show me only that worksheet. The issue with the code I currently have is that its not showing the selected worksheet because the name of the different options in the dropdown list are too long. I guess the solution would be to create a VBA code that reads the initial number of the string and then show that specific worksheet. For example: If I select "1.8 Citizen petitioner One Step Child" from the drop down list, have excel only read the initial number (as string) and only show that worksheet name, which would be worksheet named: 1.8.

    I have attached the workbook to better understand what I'm trying to explain.

    Thanks in advance for any help in this matter!!

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Show Specific Sheets in Excel With Drop Down List

    Try
    Please Login or Register  to view this content.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  3. #3
    Registered User
    Join Date
    08-23-2014
    Location
    Miami, USA
    MS-Off Ver
    365
    Posts
    69

    Re: Show Specific Sheets in Excel With Drop Down List

    Hello, thanks for your reply, but it doesn't open the worksheet selected from the dropdown menu.

  4. #4
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Show Specific Sheets in Excel With Drop Down List

    A couple of minor changes.

    1. You need a space after the worksheet name, otherwise you'll make Sheet 1.1 visible when you select 1.11,1.12 etc.
    2. You need to Activate your sheet
    Please Login or Register  to view this content.
    I've also noticed that you have a case mismatch for " ALL"/" All"

    That should be rectified in this bit of code
    Please Login or Register  to view this content.
    Last edited by Croweater; 09-27-2023 at 09:23 PM.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Show Specific Sheets in Excel With Drop Down List

    In sheet "MENU" 's module
    PHP Code: 
    Option Explicit
    Private Sub Worksheet_Change(ByVal Target As Range)
    If 
    Target.Address Range("SelectType").Address Then
        Select 
    Case Target.Value
            
    Case " ALL"
                
    ShowAllSheets
            
    Case ""
            
    Case Else
                
    ShowSelSheets
        End Select
    End 
    If
    End Sub 
    In General module
    PHP Code: 
    Option Explicit
    Sub ShowAllSheets
    ()
    Dim ws As Worksheet
    For Each ws In ActiveWorkbook.Sheets
      ws
    .Visible xlSheetVisible
    Next ws
    End Sub
    Sub ShowSelSheets
    ()
    Dim ws As Worksheet
    Dim strType 
    As String
    strType 
    Worksheets("Menu").Range("SelectType").Value
    For Each ws In ActiveWorkbook.Sheets
        ws
    .Visible xlSheetHidden
        
    If Split(strType)(0) = ws.Name Or ws.Name "Menu" Then ws.Visible xlSheetVisible
    Next
    End Sub 
    Attached Files Attached Files
    Quang PT

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Show Specific Sheets in Excel With Drop Down List

    sandy1977,

    1) To Menu sheet code module.
    Please Login or Register  to view this content.
    2) Module1 code.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Show Specific Sheets in Excel With Drop Down List

    Quote Originally Posted by bebo021999 View Post
    Quang PT
    Inbox me for: tutoring - more complex requests.
    paypal: [email protected]
    https://www.facebook.com/ThuThuatExcelQuanTriKetoan
    I almost missed this in the 'fine print', having been overcome by the stunning innovation and unprecedented wisdom of the previous two posts, however,
    I assume that now we are permitted to advertise for professional services on this forum?

    I must have missed this change to forum rules. Could the admins/mods please enlighten me as to when this happened, as I would like to offer my professional services in the
    spirit of free enterprise and open competition.

    So much for the oft paraphrased 'we are all unpaid volunteers on this site'.

+ 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. Need to show all Sheets chosen from the drop-down list
    By AllanaSM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2023, 02:33 PM
  2. Replies: 2
    Last Post: 03-11-2022, 07:03 AM
  3. Replies: 6
    Last Post: 02-16-2017, 05:08 PM
  4. Replies: 5
    Last Post: 04-11-2014, 03:13 PM
  5. Excel drop down, automatically show list for selection
    By KALATRASH81 in forum Excel General
    Replies: 1
    Last Post: 01-08-2014, 07:37 AM
  6. [SOLVED] Select from drop down list to show another drop down list in a different cel
    By ExcelRanger in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-22-2012, 04:27 PM
  7. Replies: 4
    Last Post: 01-18-2012, 07:43 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