Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Displaying Hidden sheets in a dropdown?

Posted on 2014-01-18
2
Medium Priority
?
306 Views
Last Modified: 2014-01-19
I have  userform the displays a dropdown with all the sheet tabs in a workbook, however it shows the hidden ones too.  Is there a way to edit below so that hidden sheet tabs are not in the list?  Please advise and thanks. -R-


Option Explicit

Private Sub cmdGoTo_Click()
    If cboSheets.ListIndex <> -1 Then
        Application.Goto Worksheets(cboSheets.Value).Range("A1")
        Unload Me
    End If
End Sub



Private Sub UserForm_Initialize()
Dim I As Long

    For I = 1 To Worksheets.Count
        cboSheets.AddItem Worksheets(I).Name
    Next I
End Sub

Open in new window

0
Comment
Question by:RWayneH
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 2000 total points
ID: 39790627
Private Sub UserForm_Initialize()
Dim I As Long

    For I = 1 To Worksheets.Count
        if Worksheets(I).Visible=xlSheetVisible then
            cboSheets.AddItem Worksheets(I).Name
        end if
    Next I
End Sub
0
 

Author Closing Comment

by:RWayneH
ID: 39792022
Thanks. -R-
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question