View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Umlas Bob Umlas is offline
external usenet poster
 
Posts: 301
Default Protect a worksheet with a password

Viewing a worksheet is not prevented by password protecting it. Try
something like this. If Sheet2 should be the "culprit": right-click the
sheet tab for Sheet2, select View Code, Put this code in:

Private Sub Worksheet_Activate()
With ActiveWindow
.Windowstate=xlminimized
If inputbox("Password?") < "Putyourpasswordhere" Then
Sheets(1).Select
.Windowstate=xlmaximized
End With
End Sub

Bob Umlas
Excel MVP
"colettey29" wrote in message
...
I have 20+ worksheets in a single workbook - I want to protect only one of
those worksheets with a password. (I don't want anyone to be able to view
that specific worksheet unless they have the password.) How can I do

this?