Hiding and not allow others to unhide worksheets

cricket1001

New Member
Joined
Dec 5, 2011
Messages
12
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a workbook with employee information that needs to be put in a public folder for employees to have access to. Is there a way I can hide about 5 of the worksheets allowing other employees access to only about 4 other worksheets? I need for the employees not to be able to unhide those worksheets that I hide. I'd hate to have to copy the 4 worksheets into another workbook that the employees would have access to in order to keep certain personal info private. If I do that, then when any info changes in those 4 worksheets, I would have to make changes to both workbooks.
 
Last edited by a moderator:

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Cross posted https://www.excelforum.com/excel-ge...nd-not-allow-others-to-unhide-worksheets.html

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
You could put this in the code module for each of the secret sheets. (Change the password for each sheet)
It assumes that you have a worksheet named Master
Code:
' in secret sheet code module

Private Const Password = "password"

Private Sub Worksheet_Activate()
    Static abort As Boolean
    If abort Then abort = False: Exit Sub
    ThisWorkbook.Sheets("Master").Activate
    If Application.InputBox("Password", Type:=2) = Password Then
        abort = True
        Me.Activate
    End If
End Sub
And then this in the ThisWorkbook code module.
Code:
' in ThisWorkbook code module

Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Me.Worksheets("Master").Activate
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Me.Worksheets("Master").Activate
End Sub

Note: Excel is so insecure that using Excel to store confidential information may not meet a "due diligence" standard.
 
Last edited:
Upvote 0
Solution
In vba property choose veryhidden option for the sheet you qant to hide. Thia way unhide option will be disabled.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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