Speed Up this macro?

F

Faisal...

I am sorry for the confusion caused in my last two posts. Adding to
JP's comment, try this:
Private Sub CommandButton5_Click()


Application.ScreenUpdating = False

Activesheet.Unprotect(PASSWORD)

Dim cell As Range, rng As Range
Cells.Rows.Hidden = False
On Error Resume Next
Set rng = Columns(2).SpecialCells(xlConstants, xlNumbers)
On Error GoTo 0
For Each cell In rng
If cell.Value = 0 Then
cell.EntireRow.Hidden = True
End If
Next

Activesheet.Protect Password:="Secret", UserInterFaceOnly:=True

Application.ScreenUpdating = True


End Sub
 

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