Results 1 to 9 of 9

Hiding multiple rows based on different target values

Threaded View

  1. #1
    Registered User
    Join Date
    09-30-2020
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    26

    Hiding multiple rows based on different target values

    Hi all,

    I have a worksheet within which the user selects whether an event is either; On-site (Bridport), Customer (UK) or Customer (International) and based on their choice different rows are hidden. There are 6 different events all with the 3 options and therefore different rows to hide.

    I have the below code that works well for the first event, however, I'm having problems trying to extend it to the multiple events and options. Can anyone help?

    The Target Cells are: B3, B17, B30, B44, B57, B70



    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
    If Target.Address = Range("B3").Address Then
    With ActiveSheet
    Select Case Target.Value
    Case "On-site (Bridport)"
        .Rows.Hidden = False
        Rows("6:11").Hidden = True
    Case "Customer (UK)"
        .Rows.Hidden = False
        Rows("6:8").Hidden = True
        
    Case "Customer (International)"
    .Rows.Hidden = False
    
    Case "-"
    .Rows.Hidden = False
        
    'add more here as needed
    End Select
    End With
    End If
    
    End Sub
    Last edited by help85; 11-09-2021 at 04:10 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Hiding rows based on Multiple List.
    By Glitch_ in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2014, 12:36 PM
  2. [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
  3. VBA hiding rows target.value referring to range in another worksheet error
    By siddas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2013, 08:55 AM
  4. 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
  5. 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
  6. Hiding rows based on multiple calculations
    By carlito_1985 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2010, 07:28 PM
  7. Hiding Rows under the influence of multiple values.
    By joavery in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-03-2008, 08:30 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