Hiding unused rows

D

davjoh123

I need to make the following procedure dynamic. Also there are blank
cells in both column E and column F that need to be skipped over for
the procedure to finish its job. Help greatly appreciated. From a user
standpoint is it easier to activate this from a button?

Sub HideRows()
On Error Resume Next
With Range("E10:F222")
..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
 
D

davjoh123

On testing the macro it is hiding more rows than I want it to, not
less. I would like it to not hide the row if there is anything in
column A Tried adding this but not successful

'.Cells(.Rows(i), 1) = "" And
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top