restricting access to a worksheet?

C

C.East

I am using Excel 2000. I have a spreadsheet on a server that can be accessed
by approximately 50 people. There are 2 worksheets in this document that
contain sensitive information and I want to limit access to these worksheets
to only to a few users exclusively. Can this be done? Thanks!
 
K

keithl816

How about require a user to enter a password.

This code will hide/unhide a sheet as needed. When you click on th
button it will prompt you for a password then open if correct, when yo
click it again it will rehide the sheet.

Add a command button to a sheet and then right click it, click on vie
code and place this code into it. Make sure to change the comman
button name/number as needed and also change the sheet name/numbe
accordingly. just make sure to password protect the VBA Project in th
VBE so that the user cannot look at the code for the password.


Code
-------------------

Private Sub CommandButton1_Click()
If Sheet1.Visible = xlSheetVisible Then
Sheet1.Visible = xlSheetVeryHidden
sCap = "Unhide " & Sheet1.name
Else
sPW = Application.InputBox("YOU ARE ATTEMPTING TO OPEN A CONFIDENTIAL FORM, ADMINISTRATIVE RIGHTS ARE REQUIRED, YOU MUST ENTER A PASSWORD TO OPEN THIS DOCUMENT")
If sPW = "password" Then
Sheet1.Visible = xlSheetVisible
sCap = "Hide " & Sheet1.name
Else
MsgBox "Incorrect Password"
sCap = "Unhide Sheet1"
End If
End If
End Su
-------------------


Hope this will help.

Larr
 
M

mevetts

Just a word of warning, it is relatively easy for anyone, even a novice
to get around passwords in Excel. Just do a quick google for examples
So, if it's info that others should definitely not see then the safes
option is not to put it out there

I am facing the same issue at the moment, I have built a workbook and
need to protect it, more so that other people don't screw it up tha
anything else
 
Top