+ Reply to Thread
Results 1 to 2 of 2

Trying to hide rows depending on drop down selection

  1. #1
    Registered User
    Join Date
    03-12-2019
    Location
    Bristol
    MS-Off Ver
    10
    Posts
    10

    Trying to hide rows depending on drop down selection

    Hi all,

    I am trying to hide cells depending on a selection of a drop down.

    I have pulled together the below (which doesn't work), and being pretty much clueless i don't know how to fix it.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$D$8" Then
    If Range("D8").Value = "Warehouse_and_Light_Industrial" Then
    Rows("13:14").EntireRow.Hidden = False

    ElseIf Range("D8").Value = "Office" Then
    Rows("13:14").EntireRow.Hidden = True

    ElseIf Range("D8").Value = "Shop" Then
    Rows("13:14").EntireRow.Hidden = True

    ElseIf Range("D8").Value = "Care_homes_for_the_elderly" Then
    Rows("13:14").EntireRow.Hidden = True

    ElseIf Range("D8").Value = "Community_centres_and_General_purpose_halls" Then
    Rows("13:14").EntireRow.Hidden = True

    ElseIf Range("D8").Value = "Sports_or_recreational_facillities" Then
    Rows("13:14").EntireRow.Hidden = True

    ElseIf Range("D8").Value = "Schools/Nurseries" Then
    Rows("13:14").EntireRow.Hidden = False

    End If
    End If
    End If
    End If
    End If
    End If
    End If
    End Sub

    The idea is that when either the choices of Warehouses and light industrial or Schools/Nurseries are selected rows 13:14 are shown. The rest of the time they are hidden.

    Any help[ would be appreciated.

    Thanks,

    Joe

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Trying to hide rows depending on drop down selection

    Please Login or Register  to view this content.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

+ 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. Hide/Unhide Rows Based On Drop Down Selection
    By QABrian in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-14-2014, 11:53 PM
  2. [SOLVED] How to hide & unhide rows based on selection from drop down box?
    By jgomez in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-02-2013, 08:30 PM
  3. Replies: 1
    Last Post: 02-01-2013, 03:06 PM
  4. [SOLVED] Hide rows from selection in drop down menu
    By TonyLB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-27-2012, 11:34 AM
  5. [SOLVED] Hide columns depending on a text selection in a drop-down list
    By hvide makelele in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2012, 04:00 PM
  6. [SOLVED] Hide rows depending on a selection in a drop-down list.
    By Kim_Mohler in forum Excel General
    Replies: 5
    Last Post: 05-02-2012, 05:40 PM
  7. Hide certain rows based on drop box selection
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-19-2010, 09:09 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