using MS excel 2010
win.7
i want the commandbutton to be disabled after max rows displayed. if that is even possible. i attached my workbook.
This my vba code:
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)
With .Offset(.Count).Resize(1)
.EntireRow.Hidden = False
.Offset(, 1).Select
End With
End With
End Sub