Results 1 to 3 of 3

Macro button protection issue

Threaded View

  1. #1
    Registered User
    Join Date
    07-06-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2003
    Posts
    9

    Macro button protection issue

    Hi,

    I've got this project with 18 sheets. The first 15 sheets are visible to everyone. But the last 3 sheets are veryhidden. I want to create a togglebutton with a password protection, so if it's enabled it shows the last 3 sheets. End if it's disabled the sheets become veryhidden again. The show and hide part is pretty easy going. But protecting it with a password stresses my brain. Maybe someone has some input for me. Here's the code I got so far. Gr. Terriz

    Private Sub Admin_button_click()
    Dim Password As String
    Answer = InputBox("Enter Password")
    Password = "admin"
        If Answer = Password Then
        Application.ScreenUpdating = False
            Admin_Button.Value = True
                Sheets("Codes-Dashboard").Visible = xlSheetVisible
                Sheets("User Database").Visible = xlSheetVisible
                Sheets("To Do!").Visible = xlSheetVisible
        Else
            Admin_Button.Value = False
                Sheets("Codes-Dashboard").Visible = xlSheetVeryHidden
                Sheets("User Database").Visible = xlSheetVeryHidden
                Sheets("To Do!").Visible = xlSheetVeryHidden
        End If
        Application.ScreenUpdating = True
    End Sub
    EDIT: I forgot to mention the problem . The enabling part works, but disabling doesn't.
    Last edited by Terriz; 08-17-2009 at 04:40 AM.

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