+ Reply to Thread
Results 1 to 7 of 7

Hiding a Worksheet w/a Password?

  1. #1
    Registered User
    Join Date
    11-06-2008
    Location
    California
    Posts
    17

    Question Hiding a Worksheet w/a Password?

    Hello Friends,

    I have a shared workbook and have locked down the cells that shouldn't be changed by other users but I also have sensitive data that I don't want to have to put on a separate file. Is there a way to password protect (or some other means) so that if the user clicks the tab, it tells them "you're not allowed to view this tab" (or something to that effect)?

    Many thanks in advance!

    Rose
    Last edited by RED Rose; 09-02-2010 at 08:04 PM.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Hiding a Worksheet w/a Password?

    Hi Rose,

    Maybe one easy option is to hide the sheet

    Press Alt + F11
    In the VBE select Ctrl + G

    Enter in the immediate window

    Sheets("Sheet1").Visible = xlVeryHidden

    Select Enter

    Of course change the name to suit your needs

    When you want to see the sheet again

    Press Alt + F11
    In the VBE select Ctrl + G

    Enter in the immediate window

    Sheets("Sheet1").Visible = True

    Select Enter

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Hiding a Worksheet w/a Password?

    Hello Rose,

    when you say "shared workbook", does that mean that several people access the workbook at the same time? If so, that will sooner or later lead to trouble. Shared workbooks are notoriously unreliable, and it's more a question of "when" rather than "if" they will become corrupt.

    If you mean that the workbook is in a shared location, and only one user accesses it at a time, you could hide the worksheet with the sensitive data, or even use VBA to set it to VeryHidden. A savvy user may be able to find a workaround, though.

    cheers,

  4. #4
    Registered User
    Join Date
    11-06-2008
    Location
    California
    Posts
    17

    Re: Hiding a Worksheet w/a Password?

    Hello and thanks for the Hide code. Can I ask a really dumb follow-up though? How do you show it again? Sorry I'm so lame.

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Hiding a Worksheet w/a Password?

    In the immediate window you can now use

    Sheets("Sheet1").Visible = True

  6. #6
    Registered User
    Join Date
    11-06-2008
    Location
    California
    Posts
    17

    Re: Hiding a Worksheet w/a Password?

    Thank you Jeffery and Teylyn! I am obviously very blind because you did mention that. I'm sorry; as I said before "I'm lame".

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Hiding a Worksheet w/a Password?

    You are very welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1