+ Reply to Thread
Results 1 to 5 of 5

Hiding specific tabs with Password protection

  1. #1
    Registered User
    Join Date
    03-04-2010
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007, Excel 2010, Excel 2003
    Posts
    87

    Hiding specific tabs with Password protection

    I am trying to figure out a macro that will hide specific tabs and that hidden tabs are password protected. But mainly hide specific tabs. I found macros that will hide and restore all tabs but not certain tabs.

    I have attached the sample file. (I already have the "Hide all and Restore All" macros.) I am still learning and a complete newbie when it comes to VBA.

    Tabs labeled "Instructions", "Cover sheet", 'Monitoring Units Worksheet" are to remain visible while
    "Monitoring Values Worksheet", "Medical Monitoring", and "Monitoring Calculator" are hidden and if possible requires a password to open

    Please be sure to include specific instructions on how to accomplish this as I am like a nervous nellie behing the steering wheel for the first time when it comes to implementing macros!

    Hope this is relatively easy
    Attached Files Attached Files
    Last edited by dawnmau; 07-29-2010 at 02:33 PM. Reason: Resolved
    Dawn - Guru in Training

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Hiding specific tabs with Password protection

    Hello dawnmau,

    I have added 2 macros and a user form to your workbook. The user form asks for a password to unhide the restricted sheets. The 2 macros hide the sheets and call the user form to show them. In VBA worksheets can be either hidden or very hidden. The difference is a worksheet that is very hidden can only be made visible again through macro code. When worksheets are very hidden, the user doesn't even know they exist, unless they open the VB editor. If you want to add another level of anti-tampering, you can password protect your VBA project. This will keep more experienced users form being able to see your VBA code. Here are the macros and the UserForm code.

    Module1 Macros
    Please Login or Register  to view this content.

    UserForm1 Code
    Change the password in bold to what you want.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    03-04-2010
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007, Excel 2010, Excel 2003
    Posts
    87

    Re: Hiding specific tabs with Password protection

    Ok I like the solution, however I have been informed that they do not need a password to "unhide". I tried to write a couple of version of an "unhide" macro and have been unsucessful. Help!

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Hiding specific tabs with Password protection

    Hello dawnmau,

    Here is the code to show the worksheets.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-04-2010
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007, Excel 2010, Excel 2003
    Posts
    87

    Re: Hiding specific tabs with Password protection

    Aha!! I now see my mistake!! Thank you so much for your help! PS I changed the 2nd "End With" to "End Sub" and it workds perfect. I also associated a Ctrl Shift hot key with both macros. This lesson will go a long way with understanding some of the coding.

    *********** 10 stars for you!

+ 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