+ Reply to Thread
Results 1 to 9 of 9

Hiding rows based on cell result

Hybrid View

BaldySlaphead Hiding rows based on cell... 12-15-2006, 07:27 AM
Carim Hi, In which cell is the... 12-15-2006, 07:41 AM
Carim Hi again, Adjust the... 12-15-2006, 07:49 AM
BaldySlaphead Thanks for that - it's great!... 12-15-2006, 08:09 AM
Carim Private Sub... 12-15-2006, 08:13 AM
BaldySlaphead Where 3,6 & 9 are just the... 12-15-2006, 08:34 AM
Carim Yes ... the offset()... 12-15-2006, 09:04 AM
BaldySlaphead Lovely - thanks for all your... 12-15-2006, 09:13 AM
Carim You are welcome ... Thanks... 12-15-2006, 11:57 AM
  1. #1
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Private Sub Worksheet_Change(ByVal Target As Range)
    Set Target = Range("A1")
    If Target.Value = "No" Then
    Target.Offset(3, 0).EntireRow.Hidden = True
    Target.Offset(6, 0).EntireRow.Hidden = True
    Target.Offset(9, 0).EntireRow.Hidden = True
    ElseIf Target.Value = "Yes" Then
    Target.Offset(3, 0).EntireRow.Hidden = False
    Target.Offset(6, 0).EntireRow.Hidden = False
    Target.Offset(9, 0).EntireRow.Hidden = False
    End If
    End Sub
    HTH
    Carim

  2. #2
    Registered User
    Join Date
    10-02-2003
    Location
    East Midlands, UK
    MS-Off Ver
    MS Office Professional Plus 2016
    Posts
    40
    Where 3,6 & 9 are just the relative distance from the target row, yes?

    And - sorry to be a nuisance - if I need to have more than one of these things on the same worksheet, how do I do that? I tried pasting the thing and renaming the subroutine to Worksheet_Change2 and also changing the variable name target to target2, but no luck...

  3. #3
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Yes ... the offset() function, to use your terminology, works with "relative distance" ....

    You can have many worksheets events with different events ... but for a given event you can only have one of each ...
    Solution : code all your requirements within that particular one ...

    HTH
    Carim

  4. #4
    Registered User
    Join Date
    10-02-2003
    Location
    East Midlands, UK
    MS-Off Ver
    MS Office Professional Plus 2016
    Posts
    40
    Lovely - thanks for all your help!

  5. #5
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    You are welcome ...

    Thanks for the feedback

    Carim

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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