Results 1 to 3 of 3

VBA help with opening hidden sheets with a password

Threaded View

  1. #1
    Registered User
    Join Date
    06-24-2018
    Location
    U.S
    MS-Off Ver
    15.0.5041.1001
    Posts
    6

    VBA help with opening hidden sheets with a password

    Hey all. I am new to VBA and am working on a project that now has me obsessed and stressed - until I figure it out.

    I have a workbook with several sheets. The main "HOME" sheet has hyperlinks to each sheet.
    My question is - how do I hide one sheet "The ADMIN sheet" and still activate it?

    I created a userform for the Admin link so the user has to enter a password to access that sheet. It works great - until I hide the sheet. As soon as I do this, the link is broken.

    Here is the coding I am using that works when the sheet is visible. What parts do I need to modify so it will still work when the sheet is hidden?
    Thank you!
    Private Sub cmdOPEN1_Click()
    'Attached to On Click event of AdminPage
    
        Dim strPasswd
    
        strPasswd = InputBox("Please Enter Password", "Restricted Form")
    
        'Check to see if there is any entry made to input box, or if
        'cancel button is pressed. If no entry made then exit sub.
    
        If strPasswd = "" Or strPasswd = Empty Then
            MsgBox "No Input Provided", vbInformation, "Required Data"
            Exit Sub
        End If
    
        'If correct password is entered open AdminPage
        'If incorrect password entered give message and exit sub
    
        If strPasswd = "password" Then
        
        'Activate Worksheet
         Sheets("AdminPage").Activate
        Else
            MsgBox "Sorry, you do not have access to this form", _
                   vbOKOnly, "Important Information"
            Exit Sub
        End If
    End Sub
    Last edited by Leith Ross; 06-28-2018 at 10:23 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hide all sheets (very hidden) except one or Unhide all sheets with password
    By wmdriver in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2015, 07:21 AM
  2. Command Button that shows Hidden Sheets - Needs Password Protection
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-17-2014, 01:30 AM
  3. [SOLVED] I want to password protect but only hidden sheets
    By katieshields in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-15-2013, 03:38 AM
  4. Password on hidden excel sheets by click-on-chart
    By Cleopatran in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-21-2013, 04:35 AM
  5. Opening Multiple sheets and inserting password
    By afelipe2001 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2013, 02:13 PM
  6. Split data into multiple sheets and to be hidden and password protected to unhide
    By anchuri_chaitanya in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-30-2012, 11:36 PM
  7. different password to unhide the hidden sheets.
    By Rahul Nagar in forum Excel General
    Replies: 6
    Last Post: 11-24-2008, 01:56 PM

Tags for this Thread

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