+ Reply to Thread
Results 1 to 3 of 3

Hide rows for blank Cells when there is another blank cell below

  1. #1
    Registered User
    Join Date
    12-09-2016
    Location
    Irvine, CA
    MS-Off Ver
    2013
    Posts
    32

    Hide rows for blank Cells when there is another blank cell below

    Hi,

    I have spreadsheet that has VBA to hide rows based on column F being 0. The formula works perfect except for one issue. There are Headings in Column D that have Blanks in column F and they need to stay if any of the cells below the heading have a value, but be hidden if the cell below is a blank. Is there a way anyone knows how this can be accomplished? My current code is as follows, but all the blank are left in it.


    Please Login or Register  to view this content.

    Thank you!

  2. #2
    Registered User
    Join Date
    12-09-2016
    Location
    Irvine, CA
    MS-Off Ver
    2013
    Posts
    32

    Re: Hide rows for blank Cells when there is another blank cell below

    I have figured out the solution in part. Here is the code after my soution:

    Please Login or Register  to view this content.

    The problem is with this line:

    Please Login or Register  to view this content.
    I have data as follows:

    Description (With blank in Column F)
    Data (With value in Column F, Will be 0 or Positive number)

    If the Description has only data underneath that is 0 I want the Description to hide, but with the code I have written it will hide the description if the the cell below is 0 and say 3 columns down there is data. That leaves the data without a Description. I want the Description to only be removed if there is not data under the Description. My thought was (not sure if this is how VBA works, still fairly new) if the first part of my code hides the data that need to be hidden, then the next part of my would only hide the header if the visible cell below is a blank. Is there a way to make that happen?

    I hope I was clear in my description, but if I am not clear please let me know and I will try and explain it better.




    Thanks!

  3. #3
    Registered User
    Join Date
    12-09-2016
    Location
    Irvine, CA
    MS-Off Ver
    2013
    Posts
    32

    Re: Hide rows for blank Cells when there is another blank cell below

    Hi,

    I was given the following code that solved my problem from a someone, but they did not have time to explain it for me. It is functional for what I want, but I was wondering if someone could help explain what is going on in the code so I can better understand it and in the future write my own code for similar circumstances. Any help is greatly appreciated.


    Please Login or Register  to view this content.


    Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hide rows if all cells are blank
    By Patish in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-15-2016, 03:55 PM
  2. Hide Rows for First Set of Consecutive Blank Cells in Column
    By pastuslm in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-22-2015, 03:22 PM
  3. [SOLVED] Hide rows when two cells are blank
    By Ravana in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-22-2015, 02:00 PM
  4. [SOLVED] Hide portions of rows if cell is blank
    By cwby44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-16-2014, 02:21 PM
  5. Hide Cells with zero values but blank rows should be ignored
    By ckozakos in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2011, 06:27 AM
  6. Hide all rows where a range of cells are blank
    By a45ward in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-02-2010, 06:29 AM
  7. Hide Rows with blank cell
    By dagindi in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-24-2010, 07:22 PM

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