How to hide rows based on multiple cell values

jellolegs

New Member
Joined
Jul 26, 2010
Messages
2
:) Hi
I need a macro to hide the entire row when all the cells of that row =""
also, the rows need to be able to unhide/rehide themselves when the data is updated.
THANKS! :)
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

SteveO59L

Well-known Member
Joined
Apr 21, 2004
Messages
7,896
:) Hi
I need a macro to hide the entire row when all the cells of that row =""
also, the rows need to be able to unhide/rehide themselves when the data is updated.
THANKS! :)


When you say "all the cells of that row"

is that all cells in the range A:IV ?

cos thats a lot
 

jellolegs

New Member
Joined
Jul 26, 2010
Messages
2
just cells from columns B:S and I wanna hide empty rows from 10 onwards. These cells have formulas in them but they show up as "" on the spreadsheet. :) thanks
 

LaneFowler

New Member
Joined
Jul 14, 2010
Messages
30
Re: How to hide rows based on cell values in two columns

Hi: I have basically the same question.

Worksheet has data in Columns A through L

Columns E and L contain dollar figures in rows 52 through 77. The cells are pre-loaded with zero dollars with anticipation that some of the zeros will be changed by the user.

If BOTH the values in Column E & L remain as Zero, I want to Hide the entire row. The Macro below stops working after it looks at the first row and will not continue to loop.

Any ideas? I think my If then statement is wrong???

Sub HideRows()
With Range("E52:E57", "L52:L57")
.EntireRow.Hidden = False
For i = 1 To .Rows.Count
If WorksheetFunction.Sum(.Rows(i)) = 0 Then
.Rows(i).EntireRow.Hidden = True
End If
Next i
End With
End Sub

Note that if I were only looking at Column E without a need to column L, the above macro will work with a change to the Range at ("E52:E77"), but when I ask Excel to analyze Two Columns, E & L, or two values in the same row, I have the issue.

Help is appreciated
 

Watch MrExcel Video

Forum statistics

Threads
1,132,740
Messages
5,655,025
Members
418,171
Latest member
ramiroayala

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
Top