+ Reply to Thread
Results 1 to 2 of 2

Help with hiding certain rows whilst others remain visible based upon multiple values.

  1. #1
    Registered User
    Join Date
    09-18-2023
    Location
    Hooton, UK
    MS-Off Ver
    Microsoft 365 Apps for Enterprise
    Posts
    12

    Question Help with hiding certain rows whilst others remain visible based upon multiple values.

    Hi, I've got a VBA scripts working well where certain rows are hidden based upon values selected from drop-down lists in specific cells.

    This is as below:
    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Cells.Count > 1 Then Exit Sub
    If Target.Value = "" Then Exit Sub
    If Target.Address = "$C$2" Then Range("78:93").EntireRow.Hidden = Target.Value = "No"
    If Target.Address = "$C$3" Then Range("16:29,31:31,37:44,45:46,48:66,72:77,94:95,97:99,101:107,120:121,127:294").EntireRow.Hidden = Target.Value = "T3/T4"
    If Target.Address = "$C$4" Then Range("122:126").EntireRow.Hidden = Target.Value = "No"

    End Sub

    What I now need some help with is to develop this code so that if the answer to the 2nd If Target .Address question isn't "T3/T4" and is "T1/T2" instead, and the answer to another question (which I will be adding so that the answer is in C5) is "No" how can I make specific rows hidden with that combination?

    Hopefully, that makes sense.

    Simon.

  2. #2
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,985

    Re: Help with hiding certain rows whilst others remain visible based upon multiple values.

    If you're changing C5 as part of this event, then you probably need to disable events.


    Please Login or Register  to view this content.

+ 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. Replies: 0
    Last Post: 03-31-2022, 05:10 AM
  2. [SOLVED] Hiding multiple rows based on different target values
    By help85 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-09-2021, 05:26 AM
  3. [SOLVED] Help with hiding rows based on Column D values
    By Ellen 2Excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-15-2014, 01:58 PM
  4. [SOLVED] Create multiple rows from cell value whilst preserving other cell values
    By Kjellis85 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 11-15-2013, 03:47 AM
  5. Excel 2007 : Hiding rows based on values in cells
    By MiserableLawStdnt in forum Excel General
    Replies: 10
    Last Post: 10-10-2011, 09:22 AM
  6. Help! Hiding rows in sheet2 based on values in sheet1
    By Oti in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-23-2011, 12:47 PM

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