This used to work...

S

Stephen

Sub CloseRows()

Application.ScreenUpdating = False
Application.EnableEvents = False

Dim ws As Worksheet

Sheets("Sheet 1").Select

For Each ws In ThisWorkbook.Worksheets
With ws
..Unprotect Password:="*****"
'.Columns("A:W").AutoFit

For i = 31 To 1000
..Cells.EntireRow.Hidden = False
If .Cells(i, 1).Value = "" Then
..Cells(i, 1).EntireRow.Hidden = True
End If
Next i
End With
Next ws



'For Each ws In ThisWorkbook.Worksheets
'ws.Protect Password:="*****", AllowFormattingCells:=True,
AllowFormattingColumns:=True, DrawingObjects:=False, Contents:=True
'Next ws

Application.ScreenUpdating = True
Application.EnableEvents = True

End Sub

But now it does nothing. I think I may have changed a setting?

Help. this is silly.
 
J

Joel

Make sure your Macro Security level is low or medium

worksheet menu - Tools - Macro - Security

I would think any other reason for it not working would produce an error
messsage. If the Password was wrong for example.
 
S

Stephen

Found it!

For i = 31 To 1000
..Cells.EntireRow.Hidden = False

should have been simply

For i = 31 To 1000
 

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