Hide Row If Any Cell In It = 0
Hi
Try this:
Sub aaa()
Dim targetRange As Range
Dim tRange As Range
Application.ScreenUpdating = False
Set targetRange = Range("A1:J100")
For Each r In targetRange.Rows
Set tRange = targetRange.Rows(r.Row)
For Each cell In tRange.Cells
If cell.Value = 0 Then
Rows(cell.Row).Hidden = True
Exit For
End If
Next
Next
Application.ScreenUpdating = True
End Sub
Regards,
Per
"robzrob" skrev i meddelelsen
...
Hello All
Searched high and low amongst the forums for this and found some close
solutions, but can't seem to make any work.
I have Rows 1-100 & Cols A-J all with formulas or text in them. If
the result of any of the formulas in any of the that range is 0, I
want the entire row hidden.
Cheers
|