+ Reply to Thread
Results 1 to 7 of 7

Password Protection and default sheets

Hybrid View

  1. #1
    Registered User
    Join Date
    01-27-2008
    Posts
    15

    Password Protection and default sheets

    Hi all,

    I'm just wondering if there is any way of providing password protection to a workbook other than the standard feature?

    What I would like is to have a seperate sheet where you can enter a password and click a button to be re-directed to one spreadsheet if the password is right and another if it is wrong. Is this possible?

    Also, is there a way of specifying a "default" sheet to open on?

    I'm a COMPLETE VB novice so any help is much appreciated.

    Thanks.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You can use the workbook_open event to specify a specific sheet

    Option Explicit
    
    Private Sub Workbook_Open()
    Sheet1.Select
    End Sub
    Here's some simple code to get a password & check it

    Option Explicit
    Sub getPW()
        Const pw1  As String = "password"
        Dim pw     As String
        pw = InputBox("Enter password?")
        If Len(pw) > 0 And pw = pw1 Then Sheet2.Select
    
    End Sub
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    01-27-2008
    Posts
    15
    Thanks for the help,

    Please see the attached file...

    What I would like to do is to enter the password in the first box so that if it's correct it goes to the sheet 'Right' and if it's wrong it goes to the sheet "Wrong". Also, I would like to make it so that the "Enter Password" sheet opens first by default.

    Thanks.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-27-2008
    Posts
    15
    Anyone know??

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You haven't even tried to use the code!
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-27-2008
    Posts
    15
    I didn't even know where to paste it in or which parts to change!

    Thanks for your help...

+ 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