+ Reply to Thread
Results 1 to 6 of 6

Hiding / Revealing rows based on Cell Value

  1. #1
    Forum Contributor
    Join Date
    02-14-2011
    Location
    West Valley City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    108

    Hiding / Revealing rows based on Cell Value

    I'm trying to find a way to hide rows based on a rows value, and have it update when a sheet is activated.

    For example, if cell O8 on sheet 1 = 1, unhide rows 29-32 on sheet 2. If O8 = 2, unhide rows 29-36.

    I'm currently trying the below code, and it isn't working.
    Please Login or Register  to view this content.
    Any suggestions?
    Last edited by Sky188; 11-01-2012 at 02:36 PM.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Hiding / Revealing rows based on Cell Value

    Hi Sky188,

    If you're running it from sheet2 then maybe you could just get rid of the Me. (The ME Dot)
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Hiding / Revealing rows based on Cell Value

    This seems to work when on the VBA tab for the sheet with the hidden rows

    Please Login or Register  to view this content.
    I'm assuming that the sheet is not protected in any way.
    Martin

  4. #4
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Hiding / Revealing rows based on Cell Value

    Hi,

    the entirerow.hidden property is either true or false, so it can't equal something else. That's why your code doesn't work. Try something like this:
    Please Login or Register  to view this content.
    Edit: oooooh now that I see others post I'm getting it. Cool!
    Last edited by RHCPgergo; 10-30-2012 at 05:08 PM. Reason: I never knew I was this bad at grammar

  5. #5
    Forum Contributor
    Join Date
    02-14-2011
    Location
    West Valley City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: Hiding / Revealing rows based on Cell Value

    Thanks for the replies everyone!
    RHCPgergo, your solution worked perfectly!
    Last edited by Sky188; 11-01-2012 at 02:36 PM.

  6. #6
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Hiding / Revealing rows based on Cell Value

    "Below is the code I'm currently using; anytime there is a value in O8, it reveals rows 29:52, regardless of what value is in O8."

    It's because of this line:
    Please Login or Register  to view this content.
    edit: if cell O8 is not empty, the above line translates to
    Please Login or Register  to view this content.
    edit2: oh, we edited at the same time. Glad it worked out in the end.
    Last edited by RHCPgergo; 11-01-2012 at 03:43 PM.

+ 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