Results 1 to 11 of 11

Hide/Unhide Sheets based on drop down list

Threaded View

  1. #5
    Registered User
    Join Date
    04-03-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    75

    Re: Hide/Unhide Sheets based on drop down list

    Dim i As Integer
    Dim SheetCount As Long
    
    SheetCount = ThisWorkbook.Worksheets.Count
    
    If Sheets("Sheet1").Cells(1, "A").Value2 = "ALL" Then
    
        For i = 2 To SheetCount
            Sheets(i).Visible = xlSheetVisible
        Next i
    Else
    
        For i = 2 To SheetCount
            If Sheets(i).Name = Sheets("Sheet1").Cells(1, "A").Value2 Then
                Sheets(i).Visible = xlSheetVisible
            Else
                Sheets(i).Visible = xlSheetHidden
            End If
        Next i
    
    End If


    Dump that into Sheet1's VBA

    EDIT: Remove the target statement all together or change the range from "A1" to "A1:A2", and just add my code to the existing "Worksheet Change" code. ....I believe is the solution
    Last edited by prjt; 08-31-2016 at 04:42 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Hide/unhide sheets based on drop-down menu
    By arindamsenaxa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2016, 10:01 AM
  2. VBA Hide/Unhide individual sheets based on selection in drop down menu
    By igullage in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-05-2015, 08:01 PM
  3. Hide/Unhide cells based on drop-down list
    By Savvy25 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2014, 02:36 AM
  4. Hide-Unhide rows on multiple worksheets based on value of a drop down list
    By clo2peter in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-10-2014, 08:32 AM
  5. [SOLVED] hide or unhide rows based on text within a drop down list
    By souimet in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2013, 01:32 AM
  6. Unhide or hide sheets based on drop down list value - need help combining these two macros
    By kstrick99999 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-02-2012, 06:07 PM
  7. Hide/unhide columns based on the drop down list value
    By vagif in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2012, 02:13 AM

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