View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
bernd bernd is offline
external usenet poster
 
Posts: 39
Default hide row + buttons and password protect

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