Hide Rows based on multiple cells

GinoZ

Board Regular
Joined
Feb 6, 2006
Messages
169
Hey Guys,

different question than I had this morning. I have a specific range (B11:D57). I want to run a macro that hides a row if ALL cells in B,C and D are empty. Most of them have an IF formula in them that does ''" if the criteria is not met. Best thing I found was the following but it also didn't help/


Code:
Public Sub Hiderows() 
Dim LRow As Integer 
Dim i As Integer 
LRow = Cells(Rows.Count, 1).End(xlUp).Row 
For i = 1 To LRow 
    If Cells(i, "C") = 0 And Cells(i, "D") = 0 And Cells(i, "E") = 0 Then 
        Rows(i).EntireRow.Hidden = True 
    End If 
Next 
End Sub
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
HI
try this modification
Code:
Public Sub Hiderows() 
Dim i As Integer 
For i = 11 To 57
If Cells(i, "B") = "" And Cells(i, "C") = "" And Cells(i, "D") = "" Then 
Rows(i).EntireRow.Hidden = True 
End If 
Next i
End Sub
Ravi
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,499
Members
449,089
Latest member
Raviguru

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