Quote Originally Posted by Logit View Post
.
Another method :

Option Explicit
Private Sub CommandButton1_Click()
Dim pass As String
    pass = "nh1234"
    ActiveSheet.Protect Password:=pass, UserInterFaceOnly:=True


With Range("A17:A42").SpecialCells(xlVisible).Areas(1)
      .Offset(.Count).Resize(1).EntireRow.Hidden = False
   
   ActiveSheet.Range("b18:d42").Select


ShowRows


End With
End Sub


Sub foo()
CommandButton1.Enabled = True
End Sub


Sub ShowRows()
    Dim rng As Range
    Dim c As Range
    Dim sTemp As String


    Set rng = Range("A18:A42")
    sTemp = ""


    For Each c In rng
        If c.EntireRow.Hidden Then
            sTemp = sTemp & "Row " & c.Row & vbCrLf
        End If
    Next c


    If sTemp > "" Then
        CommandButton1.Enabled = True
    Else
        CommandButton1.Enabled = False
    End If
End Sub
p45cal ... love your macro. Great code!
Thank u guys so much!!!!