ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Protecting Sheet to Prevent Viewing (https://www.excelbanter.com/excel-discussion-misc-queries/190536-protecting-sheet-prevent-viewing.html)

Aline

Protecting Sheet to Prevent Viewing
 
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

--
Thanks,
Aline


All times are GMT +1. The time now is 09:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com