+ Reply to Thread
Results 1 to 5 of 5

VBA Password Input Box - Size Change or Hide Sheet When Prompting

  1. #1
    Registered User
    Join Date
    10-18-2012
    Location
    Brighton,England
    MS-Off Ver
    Excel 2002
    Posts
    22

    VBA Password Input Box - Size Change or Hide Sheet When Prompting

    I have a worksheet with several tabs on which i am trying to protect each individual tab. The problem i am having is that when i use the VBA code it prompts me for the password but at the same time gives visibility to the sheet before any password has been entered.

    What im trying to do is to change the password prompt box to cover the screen large enough that it blocks visibility of the sheet that i would like to access, but im unsure how to do this.

    Here is the code im using,

    Private Sub Worksheet_Activate()
    a = InputBox("Please Enter Password")
    If a <> "Password" Then
    MsgBox "Wrong Password"
    Sheets("Sheet1").Visible = False
    End If



    End Sub

    Any help is appreciated

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA Password Input Box - Size Change or Hide Sheet When Prompting

    I'm not sure that would work so well as the user could just move the password prompt box?

    I might be missing something but can you not keep the sheet hidden until the password has been entered?
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-18-2012
    Location
    Brighton,England
    MS-Off Ver
    Excel 2002
    Posts
    22

    Re: VBA Password Input Box - Size Change or Hide Sheet When Prompting

    Hi Yudlugar,

    Thanks for this,

    It seems to do the trick with regards to not showing the sheet until the correct password is entered. The issue is now that as soon as the sheet is selected from the row of tabs it prompts for the password and upon entering the correct password it moves to the next tab (not showing the tab which we wanted to originally view - This process just keeps repeating itself

    Hope this makes sense

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA Password Input Box - Size Change or Hide Sheet When Prompting

    Try this:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-18-2012
    Location
    Brighton,England
    MS-Off Ver
    Excel 2002
    Posts
    22

    SOLVED - Re: VBA Password Input Box - Size Change or Hide Sheet When Prompting

    That works a treat, thanks for your assistance Yudlugar

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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