Protecting Sheet to Prevent Viewing

A

Aline

Is there a easy follow up instruction on protecting sheet from viewing?

Here is what I find from Q&A, I tried but could not figure it out how it work.

Right Click the Sheet tab and select "View Code" then add
the following code. You can change the password to whatever you like.


Private Const Password As String = "DoubleOhSeven"

Private Sub Worksheet_Activate()
Me.Visible = False
If InputBox("Please Enter the Password for the " & Me.Name & " Sheet",
"Enter Password") <> Password Then
Me.Visible = False
Else
Me.Visible = True
End If
End Sub
 

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