Thanks for your suggestions. I wasn't able to make them work but perhaps I didn't explain the situation clearly enough. I've also done more hunting around and come up with the following.
I have Workbook 1 which is updated with data on worksheet (“PP”) between Rows 6 to 100 and columns B:AO from Workbooks 2, 3 & 4.
Data may appear in any cell in any row. The formula for updating Workbook 1 produces a zero when there is no data. People look at the combined data in Workbook 1 and I want to hide all the rows on which there is no data. The code below seems to work to do this but it seems a very long and roundabout way of doing it.
Can anyone suggest a more elegant code to achieve my aim.
Dim rngCell As Range
Dim rng As Range
Set rng = Sheets("PP").Range("a6:a100")
For Each rngCell In rng.Rows
If Trim(rngCell.Offset(, 0) & rngCell.Offset(, 1) & rngCell.Offset(, 2) _
& rngCell.Offset(, 3) & rngCell.Offset(, 4) & rngCell.Offset(, 5) & rngCell.Offset(, 6) & rngCell.Offset(, 7) ….etc until Column AO = 0 Then
rngCell.EntireRow.Hidden = True
End If
Next rngCell
Thanks for any assistance anyone can offer.
Bookmarks