• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Creating a password to access a single cell, or worksheet

Helixx

New Member
Hi All,


Here is what I want to do: have the contents of a cell, or a couple of cells only viewable when the correct password is provided. Although I would not consider myself an advanced user, I am aware of the basic concepts of protection. In this case, I am not asking about protecting the cell or worksheet. Basically, I don't care who can see this certain worksheet, but I have two cells with sensitive information that I want to be revealed only to those with the password. Is this possible? If not, then I would like to hide the entire worksheet from users without the password, or at least make it inaccessable to them. The idea is that many users will receive the workbook, but I only want select users to be able to access the sensitive information on one certain worksheet. If I am not clearly communicating my request please ask questions. Thanks!
 
The only true way to protect the sensitive information would be to store it in a seperate workbook, and mail that workbook to the people that need it.


With the use of formulas and/or macros, nothing is "secure" in an Excel workbook.


If this information is used in formulas, my recommendation would be to copy, paste values those formulas to become static. Granted, you should first save a copy of the file so you could have a master file (with formulas) and one w/o formulas.
 
100% security in not necessary. The list of people who will receive the workbook (which contains over 40 worksheets) is short, and all internal teams within my company. If one of them wanted to crack it, they could get the information easier than hacking my worksheet, but even then it is still internal. The idea is to make it easy for those with the password, difficult and obviously a deliberate hack for those without the password. That being said, no one who is not privy to the information will try to access it because we are all honest, and again, it's a short list of folks who will receive the workbook, and only two people who will have the password.


BTW...emailing the sensitive information in a separate workbook is the exact situation from which I am trying to get away.
 
Can the sensitive data be on it's own worksheet, or is it on a worksheet with other data that everyone needs to see?
 
The sensitive data is in fact on its own worksheet. Not all of the data on that worksheet is sensitive, but all of the data on that worksheet pertains only to the individuals who are privy to the sensitive information, therefore the entire worksheet and all its data can be inaccessable to all who do not possess the password.
 
Here's a macro you could install and use for basic security.


Sub PasswordCheck()

Dim xWord As String

Dim MyPassword As String

Dim MySheet as String


'change this as appropriate

MyPassword = "Some phrase"

MySheet = "Sensitive Data"


xWord = InputBox("What is the password?", "Password check")

If xWord = MyPassword Then

Worksheets(MySheet).Visible = -1

Else

Worksheets(MySheet).Visible = 2

End If

End Sub


Note that you need to change the password defintion (which is case sensitive) and sheet name. Macro sets the sheet to "very hidden" (can't be unhidden w/o using VB). For a little extra protection, I recommend putting a password on the VB project when you're done.
 
Back
Top