Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Hide Rows if Cells in a Column are blank

  1. #1
    New Member
    Join Date
    Jul 2019
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Hide Rows if Cells in a Column are blank

    Hello everyone,

    I specifically made an account so I can figure out how to do this in Excel. So what Im trying to do is hide the rows when cells from a range of columns does not have data in it.

    Example: K4:Q4 will be filled in with data and if theres no data on this entire column then I would like to hide rows A2:A8 because that encompasses information for each of those data.

  2. #2
    Board Regular My Aswer Is This's Avatar
    Join Date
    Jul 2014
    Posts
    15,820
    Post Thanks / Like
    Mentioned
    28 Post(s)
    Tagged
    13 Thread(s)

    Default Re: Hide Rows if Cells in a Column are blank

    You said:
    Example: K4:Q4 will be filled in with data and if theres no data on this entire column then I would like to hide rows A2:A8 because that encompasses information for each of those data.

    K4:Q4 is not a column

    You said:
    hide rows A2:A8

    A2:A8 is not a row.

    Please explain

    You cannot Hide part of a column or part of a row.

    Be sure and always test this script on sample data the first time you use this as to avoid any problems with your data. Always trying to learn more and help others where I can. I'm using Excel 2013.
    Patience please I知 not perfect yet. "Memories are forever"

  3. #3
    New Member
    Join Date
    Jul 2019
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hide Rows if Cells in a Column are blank

    Quote Originally Posted by My Aswer Is This View Post
    You said:
    Example: K4:Q4 will be filled in with data and if theres no data on this entire column then I would like to hide rows A2:A8 because that encompasses information for each of those data.

    K4:Q4 is not a column

    You said:
    hide rows A2:A8

    A2:A8 is not a row.

    Please explain

    You cannot Hide part of a column or part of a row.

    I meant to say cells K4:Q4 would have the data and if no data are in those cells then cells A2:A8 should be hidden.

    A K L M N O P Q
    1 Name 0 0 0 0 0 0 0
    2 Blank Cell
    3 Blank Cell
    4 Blank Cell
    5 Blank Cell
    6 Blank Cell
    7 Blank Cell
    8 Blank Cell

    The entire Rows of A1:A8 will be hidden.

  4. #4
    Board Regular My Aswer Is This's Avatar
    Join Date
    Jul 2014
    Posts
    15,820
    Post Thanks / Like
    Mentioned
    28 Post(s)
    Tagged
    13 Thread(s)

    Default Re: Hide Rows if Cells in a Column are blank

    You cannot hide cells.

    You must hide a entire row or entire column

    You said:
    The entire Rows of A1:A8

    Do you mean hide Entire Column A
    Be sure and always test this script on sample data the first time you use this as to avoid any problems with your data. Always trying to learn more and help others where I can. I'm using Excel 2013.
    Patience please I知 not perfect yet. "Memories are forever"

  5. #5
    New Member
    Join Date
    Jul 2019
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hide Rows if Cells in a Column are blank

    Quote Originally Posted by My Aswer Is This View Post
    You cannot hide cells.

    You must hide a entire row or entire column

    You said:
    The entire Rows of A1:A8

    Do you mean hide Entire Column A
    Right, so the entire Rows of A2:A8.

  6. #6
    Board Regular My Aswer Is This's Avatar
    Join Date
    Jul 2014
    Posts
    15,820
    Post Thanks / Like
    Mentioned
    28 Post(s)
    Tagged
    13 Thread(s)

    Default Re: Hide Rows if Cells in a Column are blank

    You should say:
    Hide Rows 2 to 8
    Be sure and always test this script on sample data the first time you use this as to avoid any problems with your data. Always trying to learn more and help others where I can. I'm using Excel 2013.
    Patience please I知 not perfect yet. "Memories are forever"

  7. #7
    Board Regular My Aswer Is This's Avatar
    Join Date
    Jul 2014
    Posts
    15,820
    Post Thanks / Like
    Mentioned
    28 Post(s)
    Tagged
    13 Thread(s)

    Default Re: Hide Rows if Cells in a Column are blank

    But I do not understand your ultimate goal.

    You need to say something like:

    Any cell in column B if the cell is empty delete the entire row.
    Be sure and always test this script on sample data the first time you use this as to avoid any problems with your data. Always trying to learn more and help others where I can. I'm using Excel 2013.
    Patience please I知 not perfect yet. "Memories are forever"

  8. #8
    New Member
    Join Date
    Jul 2019
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hide Rows if Cells in a Column are blank

    I'm not good at Excel so I might be getting a little ahead of myself but yeah I want to hide rows 2 to 8 if K4:Q4 are blank

  9. #9
    New Member
    Join Date
    Jul 2019
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hide Rows if Cells in a Column are blank

    I don't want to delete the entire row as the data in the worksheet is updated weekly. Its just that certain cells are not filled in one week but are used at some other week. I just need the rows to be hidden temporarily.

  10. #10
    Board Regular My Aswer Is This's Avatar
    Join Date
    Jul 2014
    Posts
    15,820
    Post Thanks / Like
    Mentioned
    28 Post(s)
    Tagged
    13 Thread(s)

    Default Re: Hide Rows if Cells in a Column are blank

    Try this:
    Code:
    Sub Hide_Rows_If()
    'Modified 7/23/2019 6:05:58 PM  EDT
    Application.ScreenUpdating = False
    Dim r As Range
    Dim x As Long
    For Each r In Range("K4:Q4")
        If r.Value = "" Then x = x + 1
    Next
    If x = 7 Then Rows(2).Resize(7).Hidden = True
    Application.ScreenUpdating = True
    End Sub
    Be sure and always test this script on sample data the first time you use this as to avoid any problems with your data. Always trying to learn more and help others where I can. I'm using Excel 2013.
    Patience please I知 not perfect yet. "Memories are forever"

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •