Private Sub CommandButton1_Click()
'Sub rowhide()
' rowhide Macro
' Macro recorded 02/06/2006 by riaz
' first, find last cell
If CommandButton1.Caption = "Hide all" Then
ActiveSheet.Unprotect
For myrow = 16 To 416
If ActiveSheet.Range("a" & myrow) = 0 Then
ActiveSheet.Rows(myrow).EntireRow.Hidden = True
End If
Next myrow
CommandButton1.Caption = "Show all"
ActiveSheet.PROTECT DrawingObjects:=True, Contents:=True, Scenarios:=True
Else
ActiveSheet.Unprotect
ActiveSheet.Rows.EntireRow.Hidden = False
ActiveSheet.Columns.EntireColumn.Hidden = False
CommandButton1.Caption = "Hide all"
ActiveSheet.PROTECT DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
End Sub