+ Reply to Thread
Results 1 to 4 of 4

Efficient way to Hide all rows with a 0 in a column every time a cell value is changed

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

    Efficient way to Hide all rows with a 0 in a column every time a cell value is changed

    Good evening all,

    I'm looking for an efficient way to hide upwards of a thousand rows that have zero's in a single column every time a data validation cell is changed.

    To elaborate, in A1 I'll have a data validation that brings the list of Red, Green, and Blue. If red is chosen, it shows row 2-20, hides rows 21-60. If Green is chosen, it shows rows 21-40, and hides rows 2-20, and 41-60. If Blue is chosen, it shows rows 41-60, and hides 2-40. (see below code)

    Please Login or Register  to view this content.
    With each section of rows hidden / shown, some of the rows have a 1 in column A, and others have a 0 (For example, when red is chosen and rows 2-20 are shown, A2 = 1, A3 = 1, A4-A10 = 0, A11-A20 = 1).

    What I'm looking for is some way that will hide all these rows that have 0s, and only show the ones with 1s.

    I've found multiple ways of doing this, though the majority take 30 minutes + to go through (my actual document has 9000 lines that this needs to happen with), and the one I've found (posted below) that works well, brings back an error when I try clearing the data validation list (which hides all rows (1-60).


    Please Login or Register  to view this content.
    Last edited by Sky188; 02-28-2013 at 04:00 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: Efficient way to Hide all rows with a 0 in a column every time a cell value is changed

    Hi Sky,

    Here's a block "hide" that might work for you:

    Please Login or Register  to view this content.
    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 Contributor
    Join Date
    02-14-2011
    Location
    West Valley City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: Efficient way to Hide all rows with a 0 in a column every time a cell value is changed

    Worked wonderfully, Thanks!

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

    Re: Efficient way to Hide all rows with a 0 in a column every time a cell value is changed

    You're welcome!

+ 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