Protect a worksheet with a password

G

Guest

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?
 
B

Bob Umlas

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 said:
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?
 
G

Gord Dibben

You can hide the sheet using Format>Sheet>Hide.

Then Protect the Workbook(not worksheet) for Windows and Structure.

NOTE: password protection in Excel is easily cracked so don't use this method if
the sheet data is sensitive.


Gord Dibben MS Excel MVP
 

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