+ Reply to Thread
Results 1 to 10 of 10

Hide Row if ALL cells in Rng are Blank

  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Hide Row if ALL cells in Rng are Blank

    Greetings, Gurus.

    I found this in my search, offered by the brilliant Roy UK:

    This will hide all rows that have blank cells in C or D

    Please Login or Register  to view this content.
    My question is, how would I modify this code to only hide the rows where ALL of the cells in columns E thru G were blank?

    Thanks in advance for any help you can offer.
    Last edited by [email protected]; 08-27-2009 at 04:18 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Hide Row if ALL cells in Rng are Blank

    Is this what you mean
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Hide Row if ALL cells in Rng are Blank

    How's it going, Roy? Thanks for the response.

    That didn't seem to do it, but I think there is a better way. In the attached sample, you will notice I have accumulated information for each part number, and for each week. The buttons I have at the top are supposed to make it easier to navigate, but in a spreadsheet with thousands of part numbers, it still looks like a jumble.

    What I would like to do is put a button above each date that would hide all rows that don't show an entry, under either of the 3 columns, for THAT date.

    For example, if the user clicked the "Show ETA" button, then clicked the "Hide Blank Rows" button above the date "8/15 to 8/21", only the rows containing data for that date would be displayed. The tricky part is, if I've already hidden some of the columns by clicking to "Show ETA", then the range I want to check has changed. I no longer would need to hide rows in which all cells E thru G are blank, I only need to hide the rows in whcih column F are blank.

    Am I making any sense? Can this be done, or do I need to look in another direction?

    Thanks for the help.
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Hide Row if ALL cells in Rng are Blank

    I'm not really clear what you are doing. The buttons disappear when the rows are hidden because you are hiding row 1 Tis prevents that
    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Hide Row if ALL cells in Rng are Blank

    Okay, Roy. I changed that part of the code in the new sample I have attached. But still, when I press the "Hide Blank Rows" button, the only row that gets hidden is row 3.
    Attached Files Attached Files

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Hide Row if ALL cells in Rng are Blank

    I think you want to hide rows if the cells in cells of that row in E,F,G are all blank
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Hide Row if ALL cells in Rng are Blank

    Beautiful, Roy!

    I've attached the sample with the latest script included, in case you want to see what I was trying to accomplish.

    Thanks, and have a good one!
    Attached Files Attached Files

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Hide Row if ALL cells in Rng are Blank

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Hide Row if ALL cells in Rng are Blank

    Hide screen updating to tidy it upu

    Please Login or Register  to view this content.

  10. #10
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Hide Row if ALL cells in Rng are Blank

    Sorry, Roy. I had forgotten to mark the thread as Solved.

    Thanks for all your help.

+ 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