+ Reply to Thread
Results 1 to 2 of 2

use of password for tab hide/unhide using vba

  1. #1
    Registered User
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel
    Posts
    17

    use of password for tab hide/unhide using vba

    Hi All

    I have recently been looking at this forum (following a successfully answered query earlier in the year) and found some basic answers to a query i am now trying to answer. I am looking to keep a 24 tab/sheet workbook and have a userform, if possible, to offer an option for entering a password, the password would then open a set number of tabs for that authorised person to work on. When the workbook is closed the information changed is automaticly saved and all open tabs hided again ready for the next person to enter their password when the work book is opened again.

    I will need to have 4 password options...using some info found on this forum ive worked out the following code, which doesnt seem to work (the userform and save/close/hide part hasnt been started yet)

    Also, even though is doesnt work the file takes ages to open... is it clear what i am doing wrong?

    Thanks in advance.

    Tarl

    Sub PwdCheck()
    Dim Pwd As String

    Select Case LCase(Application.InputBox("Please enter your password", "test", Type:=2))
    Case "Summary"
    Sheets("S1").Visible = xlSheetVisible
    Case "Chairman"
    Sheets("CT1").Visible = xlSheetVisible
    Case "Special"
    Sheets("MWS").Visible = xlSheetVisible
    Sheets("DLMW").Visible = xlSheetVisible
    Sheets("MWSP").Visible = xlSheetVisible
    Sheets("MWRT").Visible = xlSheetVisible
    Sheets("SWS").Visible = xlSheetVisible
    Sheets("DLSW").Visible = xlSheetVisible
    Sheets("SWSP").Visible = xlSheetVisible
    Sheets("MWRTa").Visible = xlSheetVisible
    Case "Accounts"
    Sheets("MC").Visible = xlSheetVisible
    Sheets("ROLR").Visible = xlSheetVisible
    Sheets("R").Visible = xlSheetVisible
    Sheets("SP").Visible = xlSheetVisible
    Sheets("VAT").Visible = xlSheetVisible
    Sheets("Rents").Visible = xlSheetVisible
    Sheets("Rates").Visible = xlSheetVisible
    Sheets("OO").Visible = xlSheetVisible
    Sheets("VL").Visible = xlSheetVisible
    Sheets("PS").Visible = xlSheetVisible
    Sheets("EEBS").Visible = xlSheetVisible
    Sheets("CIS-PAYE tax").Visible = xlSheetVisible
    Sheets("Misc").Visible = xlSheetVisible
    End Select

    End Sub
    Last edited by innerise; 05-02-2013 at 03:50 PM. Reason: change title

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: New to VBA...

    Hi, innerise,

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    And please add Code-Tags for better readability - thanks.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine 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