sheet protection

eliking510

New Member
Joined
Mar 2, 2011
Messages
15
Hey!!
I have 5 hidden sheets and the main sheet is visible....
how can i protect the other sheets so when somone will unhide the other sheets, wil not be able to see unless he will type a password


Thanks for the help !!!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You can change the sheet from hidden to veryhidden that way they dont get to even have the chance to unhide them.

Select the sheet tab and then use right mouse button and view code
Make sure the properties window is dispalyed (View Menu) and at the bottom change Visible from xlSheetVisible to xlSheetVeryHidden
 
Upvote 0
If you just have the sheets hidden you are still allowing the users to unhide which they still can see without a password.

Look to create a button on a sheet like sheet one and add this code which will ask for a passowrd if correct then the user will see it and it becomes the selected sheet otherwise a message is displayed, test this on a new owrkbook first if it worsk then add to your workbook, then adjust the code to unhide the other sheets.

Sub unhide1()
Dim strpassword As String
strpassword = "help"
If InputBox("Please enter the password", "Test") = strpassword Then
Sheets("Sheet2").Visible = True
Sheets("Sheet2").Select
Else
MsgBox "Sorry you entered the wrong password"
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,233
Members
452,898
Latest member
Capolavoro009

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top