hide row + buttons and password protect

B

bernd

Hello,

I'v a sheet with several rows and on those rows action buttons (which
I created with the control toolbar).

When opening my excel file I want several rows in the sheet and the
actions buttons on those rows to be hidden. To unhide them another
bottun must be clicked and the user must be prompted for a password.

My code is like below, the problem is that the buttons won't hide.

Sub hide_selection()
Range("9:9,11:11").Select
Selection.EntireRow.Hidden = True
End Sub

Sub unhide_selection()
pwd = "password"
i_pwd = InputBox("password please")
Select Case i_pwd
Case pwd
Range("9:9,11:11").Select
Selection.EntireRow.Hidden = False
Case Else
MsgBox "incorrect"
End Select
End Sub

Anyone a solution?

Bernd
 
D

Dave Peterson

Rightclick on each button
choose Format control
Hello,

I'v a sheet with several rows and on those rows action buttons (which
I created with the control toolbar).

When opening my excel file I want several rows in the sheet and the
actions buttons on those rows to be hidden. To unhide them another
bottun must be clicked and the user must be prompted for a password.

My code is like below, the problem is that the buttons won't hide.

Sub hide_selection()
Range("9:9,11:11").Select
Selection.EntireRow.Hidden = True
End Sub

Sub unhide_selection()
pwd = "password"
i_pwd = InputBox("password please")
Select Case i_pwd
Case pwd
Range("9:9,11:11").Select
Selection.EntireRow.Hidden = False
Case Else
MsgBox "incorrect"
End Select
End Sub

Anyone a solution?

Bernd
 

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