Hide Rows if Cells in a Column are blank

cmerc2019

New Member
Joined
Jul 23, 2019
Messages
11
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.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
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.

 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,382
Messages
6,119,194
Members
448,874
Latest member
Lancelots

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top