View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
robzrob robzrob is offline
external usenet poster
 
Posts: 159
Default Hide Row If Any Cell In It = 0

On Jan 30, 8:24*pm, Gary''s Student
wrote:
Sub HideThem()
Dim r As Range
Set r = Range("A1:J100").SpecialCells(xlCellTypeFormulas)
Set rHide = Nothing
For Each rr In r
* * If rr.Value = 0 Then
* * * * If rHide Is Nothing Then
* * * * * * Set rHide = rr
* * * * Else
* * * * * * Set rHide = Union(rHide, rr)
* * * * End If
* * End If
Next

If rHide Is Nothing Then
Else
* * rHide.EntireRow.Hidden = True
End If
End Sub

--
Gary''s Student - gsnu201001



"robzrob" wrote:
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
.- Hide quoted text -


- Show quoted text -




Thanks. This hides the rows, then I can't seem to Unhide - they
appear to be deleted. And it's hiding rows with #REF! and blank in
them too - but I only want to test for 0.