+ Reply to Thread
Results 1 to 9 of 9

Hiding rows based on cell result

  1. #1
    Registered User
    Join Date
    10-02-2003
    Location
    East Midlands, UK
    MS-Off Ver
    MS Office Professional Plus 2016
    Posts
    37

    Hiding rows based on cell result

    Hi,

    I'm sure this is probably quite elementary really, but I can't do it.

    C7 in a particular worksheet takes a value from a list: 'Yes' or 'No'. If the value is 'Yes' I wish the entire Row 7 to be visible, if 'No' then hidden.

    That's it!

    Thanks in advance for your thoughts,

    Baldy

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    In which cell is the original choice of Yes No ... because it is this cell that the event macro has to monitor in order to hide or not your row 7 ...

    HTH
    Carim

  3. #3
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi again,

    Adjust the following to your situation ...
    Please Login or Register  to view this content.
    HTH
    Carim

  4. #4
    Registered User
    Join Date
    10-02-2003
    Location
    East Midlands, UK
    MS-Off Ver
    MS Office Professional Plus 2016
    Posts
    37
    Thanks for that - it's great!

    How about if I wish to hide more than one consecutive row? Would that just require me to change the Target.Offset e.g., if I wanted to hid three rows, would I put (6, 3), (6,9) or something else?

    Cheers,

    Baldy

  5. #5
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Please Login or Register  to view this content.
    HTH
    Carim

  6. #6
    Registered User
    Join Date
    10-02-2003
    Location
    East Midlands, UK
    MS-Off Ver
    MS Office Professional Plus 2016
    Posts
    37
    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...

  7. #7
    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

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

  9. #9
    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