Conditional hidden row

  • Thread starter rtwiss via OfficeKB.com
  • Start date
R

rtwiss via OfficeKB.com

I would like to display rows that have a certain condition and are others
that do not have this condition to be hidden. I'm thinking of and IF
Statement.

IF column b>0 OR column c>0 Then
show row
else
hide row

any suggestions?
 
B

Bernard Liengme

Here is a start for you

Sub tryme()
mylast = Cells(Cells.Rows.Count, "A").End(xlUp).Row
For j = 1 To mylast
If Cells(j, 1) = "a" Or Cells(j, 2) < 20 Then
Cells(j, 1).EntireRow.Hidden = True
End If
Next j
End Sub

best wishes
 
Top