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! :)
 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

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
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,456
Messages
5,511,487
Members
408,853
Latest member
JoshuaHudsonpTi45

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top